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

Properties

$container  : ContainerBuilder
$currentId  : mixed
$ambiguousServiceTypes  : array<string|int, mixed>
$autowiringAliases  : array<string|int, mixed>
$combinedAliases  : array<string|int, mixed>
$decoratedClass  : string|null
$decoratedId  : string|null
$decoratedMethodArgumentIndex  : int|null
$decoratedMethodIndex  : int|null
$defaultArgument  : object
$expressionLanguage  : mixed
$getPreviousValue  : Closure|null
$inExpression  : bool
$lastFailure  : string|null
$methodCalls  : array<string|int, mixed>|null
$processExpressions  : bool
$throwOnAutowiringException  : bool
$types  : array<string|int, mixed>
$typesClone  : self|null

Methods

__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.
getExpressionLanguage()  : ExpressionLanguage
populateAutowiringAlias()  : void
populateAvailableType()  : mixed
Populates the list of available types for a given definition.
populateAvailableTypes()  : mixed
Populates the list of available types.
populateCombinedAliases()  : void
set()  : mixed
Associates a type and a service id if applicable.

Properties

$ambiguousServiceTypes

private array<string|int, mixed> $ambiguousServiceTypes

$autowiringAliases

private array<string|int, mixed> $autowiringAliases

$combinedAliases

private array<string|int, mixed> $combinedAliases

$decoratedClass

private string|null $decoratedClass = null

$decoratedMethodArgumentIndex

private int|null $decoratedMethodArgumentIndex = null

$decoratedMethodIndex

private int|null $decoratedMethodIndex = null

$getPreviousValue

private Closure|null $getPreviousValue = null

$methodCalls

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

$throwOnAutowiringException

private bool $throwOnAutowiringException

Methods

__construct()

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

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

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

populateAutowiringAlias()

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

set()

Associates a type and a service id if applicable.

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

        
On this page

Search results