AutowirePass
extends AbstractRecursivePass
in package
Inspects existing service definitions and wires the autowired ones using the type hints of their classes.
Tags
Table of Contents
- $container : ContainerBuilder
- $currentId : mixed
- $ambiguousServiceTypes : mixed
- $autowiringAliases : mixed
- $decoratedClass : mixed
- $decoratedId : mixed
- $decoratedMethodArgumentIndex : mixed
- $decoratedMethodIndex : mixed
- $defaultArgument : mixed
- $expressionLanguage : mixed
- $getPreviousValue : mixed
- $inExpression : mixed
- $lastFailure : mixed
- $methodCalls : mixed
- $processExpressions : mixed
- $throwOnAutowiringException : mixed
- $types : mixed
- $typesClone : mixed
- __construct() : mixed
- process() : mixed
- You can modify the container here before it is dumped to PHP code.
- enableExpressionProcessing() : mixed
- getConstructor() : ReflectionFunctionAbstract|null
- getReflectionMethod() : ReflectionFunctionAbstract
- inExpression() : bool
- processValue() : mixed
- Processes a value found in a definition tree.
- autowireCalls() : array<string|int, mixed>
- autowireMethod() : array<string|int, mixed>
- Autowires the constructor or a method.
- createTypeAlternatives() : string
- createTypeNotFoundMessage() : string
- createTypeNotFoundMessageCallback() : Closure
- doProcessValue() : mixed
- getAliasesSuggestionForType() : string|null
- getAutowiredReference() : TypedReference|null
- Returns a reference to the service matching the given type, if any.
- getCombinedAlias() : string|null
- getExpressionLanguage() : ExpressionLanguage
- populateAutowiringAlias() : void
- populateAvailableType() : mixed
- Populates the list of available types for a given definition.
- populateAvailableTypes() : mixed
- Populates the list of available types.
- set() : mixed
- Associates a type and a service id if applicable.
Properties
$container
protected
ContainerBuilder
$container
$currentId
protected
mixed
$currentId
$ambiguousServiceTypes
private
mixed
$ambiguousServiceTypes
$autowiringAliases
private
mixed
$autowiringAliases
$decoratedClass
private
mixed
$decoratedClass
$decoratedId
private
mixed
$decoratedId
$decoratedMethodArgumentIndex
private
mixed
$decoratedMethodArgumentIndex
$decoratedMethodIndex
private
mixed
$decoratedMethodIndex
$defaultArgument
private
mixed
$defaultArgument
$expressionLanguage
private
mixed
$expressionLanguage
$getPreviousValue
private
mixed
$getPreviousValue
$inExpression
private
mixed
$inExpression
= false
$lastFailure
private
mixed
$lastFailure
$methodCalls
private
mixed
$methodCalls
$processExpressions
private
mixed
$processExpressions
= false
$throwOnAutowiringException
private
mixed
$throwOnAutowiringException
$types
private
mixed
$types
$typesClone
private
mixed
$typesClone
Methods
__construct()
public
__construct([bool $throwOnAutowireException = true ]) : mixed
Parameters
- $throwOnAutowireException : bool = true
Return values
mixed —process()
You can modify the container here before it is dumped to PHP code.
public
process(ContainerBuilder $container) : mixed
Parameters
- $container : ContainerBuilder
Return values
mixed —enableExpressionProcessing()
protected
enableExpressionProcessing() : mixed
Return values
mixed —getConstructor()
protected
getConstructor(Definition $definition, bool $required) : ReflectionFunctionAbstract|null
Parameters
- $definition : Definition
- $required : bool
Tags
Return values
ReflectionFunctionAbstract|null —getReflectionMethod()
protected
getReflectionMethod(Definition $definition, string $method) : ReflectionFunctionAbstract
Parameters
- $definition : Definition
- $method : string
Tags
Return values
ReflectionFunctionAbstract —inExpression()
protected
inExpression([bool $reset = true ]) : bool
Parameters
- $reset : bool = true
Return values
bool —processValue()
Processes a value found in a definition tree.
protected
processValue(mixed $value[, bool $isRoot = false ]) : mixed
Parameters
- $value : mixed
- $isRoot : bool = false
Return values
mixed —autowireCalls()
private
autowireCalls(ReflectionClass $reflectionClass, bool $isRoot, bool $checkAttributes) : array<string|int, mixed>
Parameters
- $reflectionClass : ReflectionClass
- $isRoot : bool
- $checkAttributes : bool
Return values
array<string|int, mixed> —autowireMethod()
Autowires the constructor or a method.
private
autowireMethod(ReflectionFunctionAbstract $reflectionMethod, array<string|int, mixed> $arguments, bool $checkAttributes, int $methodIndex) : array<string|int, mixed>
Parameters
- $reflectionMethod : ReflectionFunctionAbstract
- $arguments : array<string|int, mixed>
- $checkAttributes : bool
- $methodIndex : int
Tags
Return values
array<string|int, mixed> —createTypeAlternatives()
private
createTypeAlternatives(ContainerBuilder $container, TypedReference $reference) : string
Parameters
- $container : ContainerBuilder
- $reference : TypedReference
Return values
string —createTypeNotFoundMessage()
private
createTypeNotFoundMessage(TypedReference $reference, string $label, string $currentId) : string
Parameters
- $reference : TypedReference
- $label : string
- $currentId : string
Return values
string —createTypeNotFoundMessageCallback()
private
createTypeNotFoundMessageCallback(TypedReference $reference, string $label) : Closure
Parameters
- $reference : TypedReference
- $label : string
Return values
Closure —doProcessValue()
private
doProcessValue(mixed $value[, bool $isRoot = false ]) : mixed
Parameters
- $value : mixed
- $isRoot : bool = false
Return values
mixed —getAliasesSuggestionForType()
private
getAliasesSuggestionForType(ContainerBuilder $container, string $type) : string|null
Parameters
- $container : ContainerBuilder
- $type : string
Return values
string|null —getAutowiredReference()
Returns a reference to the service matching the given type, if any.
private
getAutowiredReference(TypedReference $reference, bool $filterType) : TypedReference|null
Parameters
- $reference : TypedReference
- $filterType : bool
Return values
TypedReference|null —getCombinedAlias()
private
getCombinedAlias(string $type[, string|null $name = null ]) : string|null
Parameters
- $type : string
- $name : string|null = null
Return values
string|null —getExpressionLanguage()
private
getExpressionLanguage() : ExpressionLanguage
Return values
ExpressionLanguage —populateAutowiringAlias()
private
populateAutowiringAlias(string $id) : void
Parameters
- $id : string
Return values
void —populateAvailableType()
Populates the list of available types for a given definition.
private
populateAvailableType(ContainerBuilder $container, string $id, Definition $definition) : mixed
Parameters
- $container : ContainerBuilder
- $id : string
- $definition : Definition
Return values
mixed —populateAvailableTypes()
Populates the list of available types.
private
populateAvailableTypes(ContainerBuilder $container) : mixed
Parameters
- $container : ContainerBuilder
Return values
mixed —set()
Associates a type and a service id if applicable.
private
set(string $type, string $id) : mixed
Parameters
- $type : string
- $id : string