Skip to content

Commit

Permalink
bug #31442 [Validator] Fix finding translator parent definition in co…
Browse files Browse the repository at this point in the history
…mpiler pass (deguif)

This PR was merged into the 4.2 branch.

Discussion
----------

[Validator] Fix finding translator parent definition in compiler pass

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Method `ChildDefintion::getParent()` returns a string, but here it is expected to return an object of class `Definition` in order to call `getClass` on it in the loop.

Commits
-------

d261bb5 Fix finding parent definition
  • Loading branch information
nicolas-grekas committed May 11, 2019
2 parents 7ca637e + d261bb5 commit 3ae1e80
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -62,7 +62,7 @@ public function process(ContainerBuilder $container)
} }


while (!($class = $translator->getClass()) && $translator instanceof ChildDefinition) { while (!($class = $translator->getClass()) && $translator instanceof ChildDefinition) {
$translator = $translator->getParent(); $translator = $container->findDefinition($translator->getParent());
} }


if (!is_subclass_of($class, LegacyTranslatorInterface::class)) { if (!is_subclass_of($class, LegacyTranslatorInterface::class)) {
Expand Down

0 comments on commit 3ae1e80

Please sign in to comment.