Skip to content

Commit ed9debd

Browse files
[FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy
1 parent 2313fb5 commit ed9debd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ValidatorBuilder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterfac
258258
*/
259259
public function setTranslator(LegacyTranslatorInterface $translator)
260260
{
261-
$this->translator = $translator instanceof LegacyTranslatorProxy ? $translator->getTranslator() : $translator;
261+
$this->translator = $translator;
262+
263+
while ($this->translator instanceof LegacyTranslatorProxy) {
264+
$this->translator = $this->translator->getTranslator();
265+
}
262266

263267
return $this;
264268
}

0 commit comments

Comments
 (0)