Copied!

Autowires a service locator based on a tag name or an explicit list of key => service-type pairs.

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 $services, ?string $indexAttribute = NULL, ?string $defaultIndexMethod = NULL, ?string $defaultPriorityMethod = NULL, array|string $exclude = [], bool $excludeSelf = true)
 
  • see \ServiceSubscriberInterface::getSubscribedServices()
  • param string|(string|\SubscribedService)[] $services A tag name or an explicit list of service ids
  • param string|null $indexAttribute The name of the attribute that defines the key referencing each service in the locator
  • param string|null $defaultIndexMethod The static method that should be called to get each service's key when their tag doesn't define the previous attribute
  • param string|null $defaultPriorityMethod The static method that should be called to get each service's priority when their tag doesn't define the "priority" attribute
  • param string|array $exclude A service id or a list of service ids to exclude
  • param bool $excludeSelf Whether to automatically exclude the referencing service from the locator
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration