-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Deprecated interface still required for TranslationInterface in Validator #31025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Validator] Deprecated interface still required for TranslationInterface in Validator #31025
Conversation
@@ -256,8 +256,11 @@ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterfac | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function setTranslator(LegacyTranslatorInterface $translator) | |||
public function setTranslator($translator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this is a BC break - but that might be OK as maybe nobody extends this class.
If not, we need to rethink the BC layer.
d247e67
to
4301a56
Compare
Accidentally closed this one |
Thinking twice, this change is wrong - as in "BC break". |
but then, we need to update FrameworkBundle to perform this wrapping. Otherwise, we force the |
btw, this also means we don't have a migration path on the ValidatorBuilder for now. |
we have one: the class is made final |
…or with LegacyTranslatorProxy (nicolas-grekas) This PR was merged into the 4.2 branch. Discussion ---------- [FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31092, #31025 | License | MIT | Doc PR | - This allows defining a translator that implements only the new interface and use it with ValidatorBuilder. ping @dvdknaap, @snebes since you were affected. Commits ------- a12656e [FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy
This PR removes the hard requirement for the LegacyValidatorInterface used by replacing the type-hint with a docBlock typehint for either the non-deprecated or deprecated TranslatorInterface.
Also, updated the test to use the new TranslatorInterface contract.