Menu

## DefinitionArray
in package
implements DefinitionSource, MutableDefinitionSource

DefinitionArray.php : 14

Reads DI definitions from a PHP array.

##### 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.

#### Constants

WILDCARD = '*'
WILDCARD_PATTERN = '([^\\\\]+)'
  Matches anything except "\".

#### Properties

$definitions : array<string|int, mixed>
  DI definitions in a PHP array.
$normalizer : DefinitionNormalizer
$wildcardDefinitions : array<string|int, mixed>|null
  Cache of wildcard definitions.

#### Methods

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

### Constants

#### WILDCARD

DefinitionArray.php : 16
`public mixed WILDCARD = '*'`

#### WILDCARD_PATTERN

DefinitionArray.php : 20

Matches anything except "\".

`private mixed WILDCARD_PATTERN = '([^\\\\]+)'`

### Properties

#### $definitions

DefinitionArray.php : 23

DI definitions in a PHP array.

`private array<string|int, mixed> $definitions`

#### $normalizer

DefinitionArray.php : 28
`private DefinitionNormalizer $normalizer`

#### $wildcardDefinitions

DefinitionArray.php : 26

Cache of wildcard definitions.

`private array<string|int, mixed>|null $wildcardDefinitions = null`

### Methods

#### __construct()

DefinitionArray.php : 30
`public __construct([array<string|int, mixed> $definitions = [] ][, Autowiring|null $autowiring = null ]) : mixed`

##### Parameters

$definitions : array<string|int, mixed> = []
$autowiring : Autowiring|null = null

#### addDefinition()

DefinitionArray.php : 58
`public addDefinition(Definition $definition) : void`

##### Parameters

$definition : Definition

#### addDefinitions()

DefinitionArray.php : 44
`public addDefinitions(array<string|int, mixed> $definitions) : void`

##### Parameters

$definitions : array<string|int, mixed>

  DI definitions in a PHP array indexed by the definition name.

#### getDefinition()

DefinitionArray.php : 66

Returns the DI definition for the entry name.

`public getDefinition(string $name) : Definition|null`

##### Parameters

$name : string

##### Return values

Definition|null

#### getDefinitions()

DefinitionArray.php : 100
`public getDefinitions() : array<string, Definition>`

##### Return values

array<string, Definition> —

Definitions indexed by their name.

## Search results