Skip to content

Commit 5f08bdf

Browse files
committed
bug #18699 [DependencyInjection] Use the priority of service decoration on service with parent (hason)
This PR was merged into the 2.8 branch. Discussion ---------- [DependencyInjection] Use the priority of service decoration on service with parent | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- d1ad43c [DependencyInjection] Fixed the priority of service decoration on service with parent
2 parents 60cce43 + d89eb96 commit 5f08bdf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

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)