removed obsolete code

This commit is contained in:
Fabien Potencier 2016-02-26 06:37:50 +01:00
parent 5554c76473
commit 6f5322ed8a
2 changed files with 0 additions and 14 deletions

View File

@ -96,7 +96,6 @@ class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
$this->updateArgumentReferences($definition->getProperties(), $currentId, $newId)
);
$definition->setFactoryService($this->updateFactoryServiceReference($definition->getFactoryService(false), $currentId, $newId), false);
$definition->setFactory($this->updateFactoryReference($definition->getFactory(), $currentId, $newId));
}
}
@ -126,15 +125,6 @@ class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
return $arguments;
}
private function updateFactoryServiceReference($factoryService, $currentId, $newId)
{
if (null === $factoryService) {
return;
}
return $currentId === $factoryService ? $newId : $currentId;
}
private function updateFactoryReference($factory, $currentId, $newId)
{
if (null === $factory || !is_array($factory) || !$factory[0] instanceof Reference) {

View File

@ -23,8 +23,6 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
$container = new ContainerBuilder();
$aDefinition = $container->register('a', '\stdClass');
$aDefinition->setFactoryService('b', false);
$aDefinition->setFactory(array(new Reference('b'), 'createA'));
$bDefinition = new Definition('\stdClass');
@ -44,8 +42,6 @@ class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
'->process() replaces alias to actual.'
);
$this->assertSame('b_alias', $aDefinition->getFactoryService(false));
$resolvedFactory = $aDefinition->getFactory(false);
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
}