8000 Do not process bindings in AbstractRecursivePass · symfony/symfony@72ffcb1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72ffcb1

Browse files
committed
Do not process bindings in AbstractRecursivePass
1 parent 4a68775 commit 72ffcb1

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ protected function processValue($value, $isRoot = false)
6767
$value->setArguments($this->processValue($value->getArguments()));
6868
$value->setProperties($this->processValue($value->getProperties()));
6969
$value->setMethodCalls($this->processValue($value->getMethodCalls()));
70-
$value->setBindings($this->processValue($value->getBindings()));
7170

7271
$changes = $value->getChanges();
7372
if (isset($changes['factory'])) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1516
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1617
use Symfony\Component\DependencyInjection\Definition;
1718
use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;
@@ -205,6 +206,25 @@ public function testProcessDetectsFactoryReferences()
205206
$this->assertCount(1, $graph->getNode('foo')->getInEdges());
206207
}
207208

209+
public function testProcessDetectsReferencesFromBoundArguments()
210+
{
211+
$container = new ContainerBuilder();
212+
213+
$container
214+
->register('a')
215+
;
216+
217+
$container
218+
->register('b')
219+
->setBindings(array(new BoundArgument($ref = new Reference('a'))))
220+
;
221+
222+
$graph = $this->process($container);
223+
224+
$this->assertCount(1, $refs = $graph->getNode('a')->getInEdges());
225+
$this->assertSame($ref, $refs[0]->getValue());
226+
}
227+
208228
protected function process(ContainerBuilder $container)
209229
{
210230
$pass = new RepeatedPass(array(new AnalyzeServiceReferencesPass()));

0 commit comments

Comments
 (0)
0