Skip to content

Commit 2140291

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Notifier][SMSBiuras] Fix CS Fix SmsBiurasTransportTest::testTestMode [Notifier][SmsBiuras] Simplify test and data provider [Notifier] [SMSBiuras] `true`/`false` mismatch for `test_mode` option [HttpKernel] Fix message for unresovable arguments of invokable controllers ignore const expressions read by phpdocumentor [DependencyInjection] Process bindings in ServiceLocatorTagPass
2 parents b4f3a4b + a93e186 commit 2140291

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Compiler/ServiceLocatorTagPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed
4040
return self::register($this->container, $value->getValues());
4141
}
4242

43+
if ($value instanceof Definition) {
44+
$value->setBindings(parent::processValue($value->getBindings()));
45+
}
46+
4347
if (!$value instanceof Definition || !$value->hasTag('container.service_locator')) {
4448
return parent::processValue($value, $isRoot);
4549
}

Tests/Compiler/ServiceLocatorTagPassTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,18 @@ public function testDefinitionOrderIsTheSame()
214214

215215
static::assertSame(['service-2', 'service-1'], array_keys($factories));
216216
}
217+
218+
public function testBindingsAreProcessed()
219+
{
220+
$container = new ContainerBuilder();
221+
222+
$definition = $container->register('foo')
223+
->setBindings(['foo' => new ServiceLocatorArgument()]);
224+
225+
(new ServiceLocatorTagPass())->process($container);
226+
227+
$this->assertInstanceOf(Reference::class, $definition->getBindings()['foo']->getValues()[0]);
228+
}
217229
}
218230

219231
class Locator

0 commit comments

Comments
 (0)