class AutowireMethodOf
Tells which method should be turned into a Closure based on the name of the parameter it's attached to.
Hierarchy
- class \Symfony\Component\DependencyInjection\Attribute\Autowire
- class \Symfony\Component\DependencyInjection\Attribute\AutowireInline extends \Symfony\Component\DependencyInjection\Attribute\Autowire
- class \Symfony\Component\DependencyInjection\Attribute\AutowireCallable extends \Symfony\Component\DependencyInjection\Attribute\AutowireInline
- class \Symfony\Component\DependencyInjection\Attribute\AutowireMethodOf extends \Symfony\Component\DependencyInjection\Attribute\AutowireCallable
- class \Symfony\Component\DependencyInjection\Attribute\AutowireCallable extends \Symfony\Component\DependencyInjection\Attribute\AutowireInline
- class \Symfony\Component\DependencyInjection\Attribute\AutowireInline extends \Symfony\Component\DependencyInjection\Attribute\Autowire
Expanded class hierarchy of AutowireMethodOf
File
-
vendor/
symfony/ dependency-injection/ Attribute/ AutowireMethodOf.php, line 20
Namespace
Symfony\Component\DependencyInjection\AttributeView source
class AutowireMethodOf extends AutowireCallable {
/**
* @param string $service The service containing the method to autowire
* @param bool|class-string $lazy Whether to use lazy-loading for this argument
*/
public function __construct(string $service, bool|string $lazy = false) {
parent::__construct([
new Reference($service),
], lazy: $lazy);
}
public function buildDefinition(mixed $value, ?string $type, \ReflectionParameter $parameter) : Definition {
$value[1] = $parameter->name;
return parent::buildDefinition($value, $type, $parameter);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
Autowire::$lazy | public | property | ||
Autowire::$value | public | property | ||
AutowireMethodOf::buildDefinition | public | function | Overrides AutowireCallable::buildDefinition | |
AutowireMethodOf::__construct | public | function | Overrides AutowireCallable::__construct |