Menu

## DecoratorDefinition extends FactoryDefinition
in package
implements Definition, ExtendsPreviousDefinition

DecoratorDefinition.php : 13

Factory that decorates a sub-definition.

##### Tags

since
  5.0
author

  Matthieu Napoli matthieu@mnapoli.fr

### Table of Contents

#### Interfaces

Definition
ExtendsPreviousDefinition
  A definition that extends a previous definition with the same name.

#### Properties

$decorated : Definition|null
$factory : callable
  Callable that returns the value.
$name : string
  Entry name.
$parameters : array<string|int, mixed>
  Factory parameters.

#### Methods

__construct() : mixed
__toString() : string
getCallable() : callable|array<string|int, mixed>|string
getDecoratedDefinition() : Definition|null
getName() : string
getParameters() : array<string|int, mixed>
replaceNestedDefinitions() : void
setExtendedDefinition() : void
setName() : void

### Properties

#### $decorated

DecoratorDefinition.php : 15
`private Definition|null $decorated = null`

#### $factory

FactoryDefinition.php : 23

Callable that returns the value.

`private callable $factory`

#### $name

FactoryDefinition.php : 17

Entry name.

`private string $name`

#### $parameters

FactoryDefinition.php : 29

Factory parameters.

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

### Methods

#### __construct()

FactoryDefinition.php : 36
`public __construct(string $name, callable|array<string|int, mixed>|string $factory[, array<string|int, mixed> $parameters = [] ]) : mixed`

##### Parameters

$name : string

  Entry name

$factory : callable|array<string|int, mixed>|string

  Callable that returns the value associated to the entry name.

$parameters : array<string|int, mixed> = []

  Parameters to be passed to the callable

#### __toString()

DecoratorDefinition.php : 32
`public __toString() : string`

##### Return values

string

#### getCallable()

FactoryDefinition.php : 56
`public getCallable() : callable|array<string|int, mixed>|string`

##### Return values

callable|array<string|int, mixed>|string —

Callable that returns the value associated to the entry name.

#### getDecoratedDefinition()

DecoratorDefinition.php : 22
`public getDecoratedDefinition() : Definition|null`

##### Return values

Definition|null

#### getName()

FactoryDefinition.php : 43
`public getName() : string`

##### Return values

string

#### getParameters()

FactoryDefinition.php : 64
`public getParameters() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

Array containing the parameters to be passed to the callable, indexed by name.

#### replaceNestedDefinitions()

DecoratorDefinition.php : 27
`public replaceNestedDefinitions(callable $replacer) : void`

##### Parameters

$replacer : callable

#### setExtendedDefinition()

DecoratorDefinition.php : 17
`public setExtendedDefinition(Definition $definition) : void`

##### Parameters

$definition : Definition

#### setName()

FactoryDefinition.php : 48
`public setName(string $name) : void`

##### Parameters

$name : string

## Search results