Menu

## SourceChain
in package
implements DefinitionSource, MutableDefinitionSource

SourceChain.php : 15

Manages a chain of other definition sources.

##### Tags

author

  Matthieu Napoli matthieu@mnapoli.fr

### Table of Contents

#### Interfaces

DefinitionSource
  Source of definitions for entries of the container.
MutableDefinitionSource
  Describes a definition source to which we can add new definitions.

#### Properties

$mutableSource : MutableDefinitionSource|null
$sources : array<string|int, mixed>

#### Methods

__construct() : mixed
addDefinition() : void
getDefinition() : Definition|null
  Returns the DI definition for the entry name.
getDefinitions() : array<string, Definition>
setMutableDefinitionSource() : void
resolveExtendedDefinition() : mixed

### Properties

#### $mutableSource

SourceChain.php : 17
`private MutableDefinitionSource|null $mutableSource`

#### $sources

SourceChain.php : 23
`private array<string|int, mixed> $sources`

### Methods

#### __construct()

SourceChain.php : 22
`public __construct(array<int, DefinitionSource> $sources) : mixed`

##### Parameters

$sources : array<int, DefinitionSource>

#### addDefinition()

SourceChain.php : 63
`public addDefinition(Definition $definition) : void`

##### Parameters

$definition : Definition

#### getDefinition()

SourceChain.php : 31

Returns the DI definition for the entry name.

`public getDefinition(string $name[, int $startIndex = 0 ]) : Definition|null`

##### Parameters

$name : string
$startIndex : int = 0

  Use this parameter to start looking from a specific point in the source chain.

##### Return values

Definition|null

#### getDefinitions()

SourceChain.php : 51
`public getDefinitions() : array<string, Definition>`

##### Return values

array<string, Definition> —

Definitions indexed by their name.

#### setMutableDefinitionSource()

SourceChain.php : 84
`public setMutableDefinitionSource(MutableDefinitionSource $mutableSource) : void`

##### Parameters

$mutableSource : MutableDefinitionSource

#### resolveExtendedDefinition()

SourceChain.php : 72
`private resolveExtendedDefinition(ExtendsPreviousDefinition $definition, int $currentIndex) : mixed`

##### Parameters

$definition : ExtendsPreviousDefinition
$currentIndex : int

## Search results