Skip to content

Commit

Permalink
bug #18699 [DependencyInjection] Use the priority of service decorati…
Browse files Browse the repository at this point in the history
…on 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
  • Loading branch information
fabpot committed May 3, 2016
2 parents a5e6172 + d1ad43c commit dd27b7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -174,7 +174,7 @@ private function resolveDefinition(ContainerBuilder $container, DefinitionDecora
if (null === $decoratedService) {
$def->setDecoratedService($decoratedService);
} else {
$def->setDecoratedService($decoratedService[0], $decoratedService[1]);
$def->setDecoratedService($decoratedService[0], $decoratedService[1], $decoratedService[2]);
}
}

Expand Down
Expand Up @@ -276,10 +276,12 @@ public function testSetDecoratedServiceOnServiceHasParent()
$container->register('parent', 'stdClass');

$container->setDefinition('child1', new DefinitionDecorator('parent'))
->setDecoratedService('foo', 'foo_inner')
->setDecoratedService('foo', 'foo_inner', 5)
;

$this->assertEquals(array('foo', 'foo_inner', 0), $container->getDefinition('child1')->getDecoratedService());
$this->process($container);

$this->assertEquals(array('foo', 'foo_inner', 5), $container->getDefinition('child1')->getDecoratedService());
}

public function testDecoratedServiceCopiesDeprecatedStatusFromParent()
Expand Down

0 comments on commit dd27b7d

Please sign in to comment.