[DependencyInjection] simplify the BC layer
The change to the `setFactoryService()` method is consistent with what we did with the `getFactoryService()` before (and how we handle the deprecation of strict references in Symfony 2.8).
This commit is contained in:
parent
3a027badb7
commit
6cd5ee3b26
@ -44,10 +44,7 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
|
||||
$definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
|
||||
$definition->setProperties($this->processArguments($definition->getProperties()));
|
||||
$definition->setFactory($this->processFactory($definition->getFactory()));
|
||||
|
||||
if (null !== $factoryService = $definition->getFactoryService(false)) {
|
||||
$definition->setFactoryService($this->processFactoryService($factoryService));
|
||||
}
|
||||
$definition->setFactoryService($this->processFactoryService($definition->getFactoryService(false)), false);
|
||||
}
|
||||
|
||||
foreach ($container->getAliases() as $id => $alias) {
|
||||
|
@ -194,9 +194,11 @@ class Definition
|
||||
*
|
||||
* @deprecated since version 2.6, to be removed in 3.0.
|
||||
*/
|
||||
public function setFactoryService($factoryService)
|
||||
public function setFactoryService($factoryService, $triggerDeprecationError = true)
|
||||
{
|
||||
if ($triggerDeprecationError) {
|
||||
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryService), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->factoryService = $factoryService;
|
||||
|
||||
|
@ -99,7 +99,7 @@ class DefinitionDecorator extends Definition
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setFactoryService($service)
|
||||
public function setFactoryService($service, $triggerDeprecationError = true)
|
||||
{
|
||||
$this->changes['factory_service'] = true;
|
||||
|
||||
|
Reference in New Issue
Block a user