While making extension, I often need some service definition in beforeCompile() method, e.g.:
After making service name optional, this is the only place where it is still required.
Everywhere I need some definition, I have to use these 2 methods:
$containerBuilder = $this->getContainerBuilder();
$serviceName = $containerBuilder->getByType(Nette\Bridges\ApplicationLatte\ILatteFactory::class);
$serviceDefinition = $containerBuilder->getDefinition($serviceName);
I would prefer having single method:
$serviceDefinition = $containerBuilder->getDefinitionByType(
Nette\Bridges\ApplicationLatte\ILatteFactory::class
);
What do you think?
While making extension, I often need some service definition in
beforeCompile()method, e.g.:After making service name optional, this is the only place where it is still required.
Everywhere I need some definition, I have to use these 2 methods:
I would prefer having single method:
What do you think?