Copied!

Allows inline service definition for an argument.

Using this attribute on a class autowires a new instance which is not shared between different services.

$class a FQCN, or an array to define a factory. Use the "@" prefix to reference a service.

CloneableInstantiable
Properties
public readonly array|bool Symfony\Component\DependencyInjection\Attribute\Autowire::$lazy
public readonly Symfony\Component\ExpressionLanguage\Expression|Symfony\Component\DependencyInjection\Reference|Symfony\Component\DependencyInjection\Argument\ArgumentInterface|array|string|?null Symfony\Component\DependencyInjection\Attribute\Autowire::$value
Methods
public __construct(array|string|?null $class = NULL, array $arguments = [], array $calls = [], array $properties = [], ?string $parent = NULL, string|bool $lazy = false)
public buildDefinition(?mixed $value, ?string $type, ReflectionParameter $parameter) : Symfony\Component\DependencyInjection\Definition
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration