minor #17565 [DependencyInjection] simplify the BC layer (xabbuh)
This PR was merged into the 2.7 branch.
Discussion
----------
[DependencyInjection] simplify the BC layer
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
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).
Commits
-------
6cd5ee3
[DependencyInjection] simplify the BC layer
This commit is contained in:
commit
528572b764
@ -44,10 +44,7 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
|
|||||||
$definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
|
$definition->setMethodCalls($this->processArguments($definition->getMethodCalls()));
|
||||||
$definition->setProperties($this->processArguments($definition->getProperties()));
|
$definition->setProperties($this->processArguments($definition->getProperties()));
|
||||||
$definition->setFactory($this->processFactory($definition->getFactory()));
|
$definition->setFactory($this->processFactory($definition->getFactory()));
|
||||||
|
$definition->setFactoryService($this->processFactoryService($definition->getFactoryService(false)), false);
|
||||||
if (null !== $factoryService = $definition->getFactoryService(false)) {
|
|
||||||
$definition->setFactoryService($this->processFactoryService($factoryService));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($container->getAliases() as $id => $alias) {
|
foreach ($container->getAliases() as $id => $alias) {
|
||||||
|
@ -194,9 +194,11 @@ class Definition
|
|||||||
*
|
*
|
||||||
* @deprecated since version 2.6, to be removed in 3.0.
|
* @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);
|
@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;
|
$this->factoryService = $factoryService;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class DefinitionDecorator extends Definition
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function setFactoryService($service)
|
public function setFactoryService($service, $triggerDeprecationError = true)
|
||||||
{
|
{
|
||||||
$this->changes['factory_service'] = true;
|
$this->changes['factory_service'] = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user