8000 [DependencyInjection] Fixed the priority of service decoration on ser… · symfony/symfony@d1ad43c · GitHub
[go: up one dir, main page]

Skip to content

Commit d1ad43c

Browse files
committed
[DependencyInjection] Fixed the priority of service decoration on service with parent
1 parent 7b3c65b commit d1ad43c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private function resolveDefinition(ContainerBuilder $container, DefinitionDecora
174174
if (null === $decoratedService) {
175175
$def->setDecoratedService($decoratedService);
176176
} else {
177-
$def->setDecoratedService($decoratedService[0], $decoratedService[1]);
177+
$def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
178178
}
179179
}
180180

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,12 @@ public function testSetDecoratedServiceOnServiceHasParent()
276276
$container->register('parent', 'stdClass');
277277

278278
$container->setDefinition('child1', new DefinitionDecorator('parent'))
279-
->setDecoratedService('foo', 'foo_inner')
279+
->setDecoratedService('foo', 'foo_inner', 5)
280280
;
281281

282-
$this->assertEquals(array('foo', 'foo_inner', 0), $container->getDefinition('child1')->getDecoratedService());
282+
$this->process($container);
283+
284+
$this->assertEquals(array('foo', 'foo_inner', 5), $container->getDefinition('child1')->getDecoratedService());
283285
}
284286

285287
public function testDecoratedServiceCopiesDeprecatedStatusFromParent()

0 commit comments

Comments
 (0)
0