function LazyTrait::lazy
Sets the lazy flag of this service.
Parameters
bool|string $lazy A FQCN to derivate the lazy proxy from or `true` to make it extend from the definition's class:
Return value
$this
File
-
vendor/
symfony/ dependency-injection/ Loader/ Configurator/ Traits/ LazyTrait.php, line 23
Class
Namespace
Symfony\Component\DependencyInjection\Loader\Configurator\TraitsCode
public final function lazy(bool|string $lazy = true) : static {
$this->definition
->setLazy((bool) $lazy);
if (\is_string($lazy)) {
$this->definition
->addTag('proxy', [
'interface' => $lazy,
]);
}
return $this;
}