Documentation

Autowire
in package

Attribute to tell a parameter how to be autowired.

Tags
author

Kevin Bond kevinbond@gmail.com

Attributes
#[Attribute]
\Attribute::TARGET_PARAMETER

Table of Contents

Properties

$lazy  : bool|array<string|int, mixed>
$value  : string|array<string|int, mixed>|Expression|Reference|ArgumentInterface|null

Methods

__construct()  : mixed
Use only ONE of the following.

Properties

$lazy read-only

public bool|array<string|int, mixed> $lazy

Methods

__construct()

Use only ONE of the following.

public __construct([string|array<string|int, mixed>|ArgumentInterface|null $value = null ][, string|null $service = null ][, string|null $expression = null ][, string|null $env = null ][, string|null $param = null ][, bool|class-string|array<string|int, class-string> $lazy = false ]) : mixed
Parameters
$value : string|array<string|int, mixed>|ArgumentInterface|null = null

Value to inject (ie "%kernel.project_dir%/some/path")

$service : string|null = null

Service ID (ie "some.service")

$expression : string|null = null

Expression (ie 'service("some.service").someMethod()')

$env : string|null = null

Environment variable name (ie 'SOME_ENV_VARIABLE')

$param : string|null = null

Parameter name (ie 'some.parameter.name')

$lazy : bool|class-string|array<string|int, class-string> = false

Whether to use lazy-loading for this argument


        
On this page

Search results