[DependencyInjection] fixed private services removal when used as configurators (closes #3758)
This commit is contained in:
parent
6f6ee95798
commit
906f6f662c
@ -74,6 +74,9 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
|
||||
if (!$this->onlyConstructorArguments) {
|
||||
$this->processArguments($definition->getMethodCalls());
|
||||
$this->processArguments($definition->getProperties());
|
||||
if ($definition->getConfigurator()) {
|
||||
$this->processArguments(array($definition->getConfigurator()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,12 +45,19 @@ class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase
|
||||
->setProperty('foo', $ref5 = new Reference('b'))
|
||||
;
|
||||
|
||||
$e = $container
|
||||
->register('e')
|
||||
->setConfigurator(array($ref6 = new Reference('b'), 'methodName'))
|
||||
;
|
||||
|
||||
$graph = $this->process($container);
|
||||
|
||||
$this->assertEquals(3, count($edges = $graph->getNode('b')->getInEdges()));
|
||||
$this->assertCount(4, $edges = $graph->getNode('b')->getInEdges());
|
||||
|
||||
$this->assertSame($ref1, $edges[0]->getValue());
|
||||
$this->assertSame($ref4, $edges[1]->getValue());
|
||||
$this->assertSame($ref5, $edges[2]->getValue());
|
||||
$this->assertSame($ref6, $edges[3]->getValue());
|
||||
}
|
||||
|
||||
public function testProcessDetectsReferencesFromInlinedDefinitions()
|
||||
|
Reference in New Issue
Block a user