Skip to content

Commit 148bdec

Browse files
committed
Do not process bindings in AbstractRecursivePass
1 parent 4a68775 commit 148bdec

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-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/CheckExceptionOnInvalidReferenceBehaviorPassTest.php

Lines changed: 17 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\Definition;
1617
use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass;
1718
use Symfony\Component\DependencyInjection\Reference;
@@ -88,6 +89,22 @@ public function testProcessThrowsExceptionOnNonSharedUninitializedReference()
8889
$this->process($container);
8990
}
9091

92+
public function testProcessDefinitionWithBindings()
93+
{
94+
$container = new ContainerBuilder();
95+
96+
$container->register('a', 'stdClass');
97+
98+
$container
99+
->register('b')
100+
->setBindings(array(new BoundArgument(new Reference('a'))))
101+
;
102+
103+
$this->process($container);
104+
105+
$this->addToAssertionCount(1);
106+
}
107+
91108
private function process(ContainerBuilder $container)
92109
{
93110
$pass = new CheckExceptionOnInvalidReferenceBehaviorPass();

0 commit comments

Comments
 (0)