-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Update Callback.rst #4161
Update Callback.rst #4161
Conversation
"Symfony\Component\Validator\ExecutionContextInterface" namespace is deprecated, new namespace should be "Symfony\Component\Validator\Context\ExecutionContextInterface"
If you typehint the new interface instead of its deprecated parent, you make your bundle incompatible with the 2.4 API. So there should at least be a note sayign that any shared bundle should typehint the interface compatible with all versions of the API. Doing such change is safe only when you control the API version to force it being 2.5 or 2.5-bc |
@stof This page belongs to documentation of version 2.5 (v2.4 has a seperate documentation), so do you really think that it is necessary to explicitly mention the issue you talk about? |
My vote is to use the non-deprecated class, and then add (which we've talked about before but haven't done yet) a cookbook entry for third-party bundle authors about doing some extra things to keep compatibility. The multiple API's is kind of a pain in the butt, so I want to hide that pain from the end user (at the expense of the more-advanced OS bundle authors). |
I agree with @weaverryan, deprecation period should also give us the chance to update the docs. |
…, weaverryan) This PR was merged into the 2.5 branch. Discussion ---------- 2.5 Validation API changes | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | 2.5 | Fixed tickets | #4094 Hi guys! This takes the work in #4056, #4105 and #4161 and extends it based on some feedback. Basically, the whole validation stuff is quite difficult, because: A) We want to show the non-deprecated methods so people use the new stuff B) We don't want to confuse users on the 2.4 API (even though this number of users should be very small, as it would require you to have started a project in the past and be using 5.3.9 and lower #4105 (comment)) This solution is to show the new way, but always show the old way in comments. This would check of A and B in #4094. Thanks! Commits ------- 9874d8e [#4233][#4094] Making validateValue and validate changes 94fc520 Minor tweaks and a missing location thanks to xabbuh and WouterJ f97ba7a Fixes thanks to @xabbuh 279d8d6 Adding a section about keeping BC in a re-usable bundle 280440e Adding details about the 2.4 API as comments e658b56 added a versionadded comment to Callback.rst 70c5ca1 Update custom_contraint.rst to meet the new 2.5 api 5dfe499 Don't use deprecated functions in Callback.rst f4380ed Update Callback.rst 042dcf9 Replace addViolationAt (deprecated) by buildViolation
"Symfony\Component\Validator\ExecutionContextInterface" namespace is deprecated, new namespace should be "Symfony\Component\Validator\Context\ExecutionContextInterface"