Documentation

AutowirePass extends AbstractRecursivePass
in package

Inspects existing service definitions and wires the autowired ones using the type hints of their classes.

Tags
author

Kévin Dunglas dunglas@gmail.com

author

Nicolas Grekas p@tchwork.com

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

$ambiguousServiceTypes

private mixed $ambiguousServiceTypes

$decoratedMethodArgumentIndex

private mixed $decoratedMethodArgumentIndex

$decoratedMethodIndex

private mixed $decoratedMethodIndex

$throwOnAutowiringException

private mixed $throwOnAutowiringException

Methods

__construct()

public __construct([bool $throwOnAutowireException = true ]) : mixed
Parameters
$throwOnAutowireException : bool = true
Return values
mixed

enableExpressionProcessing()

protected enableExpressionProcessing() : mixed
Return values
mixed

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
throws
AutowiringFailedException
Return values
array<string|int, mixed>

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

getCombinedAlias()

private getCombinedAlias(string $type[, string|null $name = null ]) : string|null
Parameters
$type : string
$name : string|null = null
Return values
string|null

populateAutowiringAlias()

private populateAutowiringAlias(string $id) : void
Parameters
$id : string
Return values
void

set()

Associates a type and a service id if applicable.

private set(string $type, string $id) : mixed
Parameters
$type : string
$id : string
Return values
mixed

Search results