[DependencyInjection] fix merge

Remove code from bugfix that deals with features removed in Symfony 3.0.
This commit is contained in:
Christian Flothmann 2016-01-27 12:37:34 +01:00
parent f204104c3b
commit 5b30cb7371
2 changed files with 1 additions and 32 deletions

View File

@ -44,10 +44,6 @@ 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));
}
}
foreach ($container->getAliases() as $id => $alias) {
@ -82,15 +78,6 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
return $arguments;
}
private function processFactoryService($factoryService)
{
if (null === $factoryService) {
return;
}
return $this->getDefinitionId($factoryService);
}
private function processFactory($factory)
{
if (null === $factory || !is_array($factory) || !$factory[0] instanceof Reference) {
@ -100,7 +87,7 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
$defId = $this->getDefinitionId($id = (string) $factory[0]);
if ($defId !== $id) {
$factory[0] = new Reference($defId, $factory[0]->getInvalidBehavior(), $factory[0]->isStrict(false));
$factory[0] = new Reference($defId, $factory[0]->getInvalidBehavior());
}
return $factory;

View File

@ -82,24 +82,6 @@ class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase
$this->assertSame('Factory', (string) $resolvedBarFactory[0]);
}
/**
* @group legacy
*/
public function testResolveFactoryService()
{
$container = new ContainerBuilder();
$container->register('factory', 'Factory');
$container->setAlias('factory_alias', new Alias('factory'));
$foo = new Definition();
$foo->setFactoryService('factory_alias');
$foo->setFactoryMethod('createFoo');
$container->setDefinition('foo', $foo);
$this->process($container);
$this->assertSame('factory', $foo->getFactoryService());
}
protected function process(ContainerBuilder $container)
{
$pass = new ResolveReferencesToAliasesPass();