Skip to content
Permalink
Browse files

bug #31442 [Validator] Fix finding translator parent definition in co…

…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 3ae1e802ada3f5114ba570595d8587ed5e00f347
@@ -62,7 +62,7 @@ public function process(ContainerBuilder $container)
}
while (!($class = $translator->getClass()) && $translator instanceof ChildDefinition) {
$translator = $translator->getParent();
$translator = $container->findDefinition($translator->getParent());
}
if (!is_subclass_of($class, LegacyTranslatorInterface::class)) {

0 comments on commit 3ae1e80

Please sign in to comment.
You can’t perform that action at this time.