Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Update Callback.rst #4161

wants to merge 1 commit into from

Conversation

lashae
Copy link
Contributor

@lashae lashae commented Aug 22, 2014

"Symfony\Component\Validator\ExecutionContextInterface" namespace is deprecated, new namespace should be "Symfony\Component\Validator\Context\ExecutionContextInterface"

"Symfony\Component\Validator\ExecutionContextInterface" namespace is deprecated, new namespace should be "Symfony\Component\Validator\Context\ExecutionContextInterface"
@stof
Copy link
Member

stof commented Aug 22, 2014

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

@lashae
Copy link
Contributor Author

lashae commented Aug 22, 2014

@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?

@stof
Copy link
Member

stof commented Aug 22, 2014

@lashae even in Symfony 2.5, the Validator API version 2.4 is not gone. It will only disappear in 3.0.

I suggest you to read the discussion in #4105

@weaverryan
Copy link
Member

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).

@lashae
Copy link
Contributor Author

lashae commented Aug 26, 2014

I agree with @weaverryan, deprecation period should also give us the chance to update the docs.

@weaverryan
Copy link
Member

Hey @lashae!

I've taken your commit and moved it to #4233 so we can summarize all the changes. Thanks for starting this! I'll close this PR.

@weaverryan weaverryan closed this Sep 16, 2014
weaverryan added a commit that referenced this pull request Oct 18, 2014
…, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants