function AutowireMethodOf::__construct
Parameters
string $service The service containing the method to autowire:
bool|class-string $lazy Whether to use lazy-loading for this argument:
Overrides AutowireCallable::__construct
File
-
vendor/
symfony/ dependency-injection/ Attribute/ AutowireMethodOf.php, line 27
Class
- AutowireMethodOf
- Tells which method should be turned into a Closure based on the name of the parameter it's attached to.
Namespace
Symfony\Component\DependencyInjection\AttributeCode
public function __construct(string $service, bool|string $lazy = false) {
parent::__construct([
new Reference($service),
], lazy: $lazy);
}