ReflectionBasedAutowiring
in package
implements
DefinitionSource, Autowiring
Reads DI class definitions using reflection.
Tags
Table of Contents
Interfaces
- DefinitionSource
- Source of definitions for entries of the container.
- Autowiring
- Source of definitions for entries of the container.
Methods
- autowire() : ObjectDefinition|null
- Autowire the given definition.
- getDefinition() : ObjectDefinition|null
- Returns the DI definition for the entry name.
- getDefinitions() : array<string, Definition>
- Autowiring cannot guess all existing definitions.
- getParametersDefinition() : array<string|int, mixed>
- Read the type-hinting from the parameters of the function.
Methods
autowire()
Autowire the given definition.
public
autowire(string $name[, ObjectDefinition|null $definition = null ]) : ObjectDefinition|null
Parameters
- $name : string
- $definition : ObjectDefinition|null = null
Return values
ObjectDefinition|nullgetDefinition()
Returns the DI definition for the entry name.
public
getDefinition(string $name) : ObjectDefinition|null
Parameters
- $name : string
Return values
ObjectDefinition|nullgetDefinitions()
Autowiring cannot guess all existing definitions.
public
getDefinitions() : array<string, Definition>
Return values
array<string, Definition> —Definitions indexed by their name.
getParametersDefinition()
Read the type-hinting from the parameters of the function.
private
getParametersDefinition(ReflectionFunctionAbstract $constructor) : array<string|int, mixed>
Parameters
- $constructor : ReflectionFunctionAbstract