Skip to content

Replace addViolationAt (deprecated) by buildViolation #4056

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

Closed
wants to merge 1 commit into from

Conversation

nicolassing
Copy link
Contributor

No description provided.

@weaverryan
Copy link
Member

Hi Nicolas!

Thanks so much for bringing this to our attention - this change seems to have slipped past the docs. 2 things:

  1. There is another addViolationAt in cookbook/validation/custom_constraint.rst. Can you change that?

  2. I believe the namespace for the ExecutionContext and ExecutionContextInterface also changed - they are now in a Context sub-namespace (https://github.com/symfony/symfony/blob/2.5/src/Symfony/Component/Validator/ExecutionContext.php versus https://github.com/symfony/symfony/blob/2.5/src/Symfony/Component/Validator/Context/ExecutionContext.php).

Actually, I believe there's some sort of API-switching mechanism between 2 different API's for 2.5 validation. I think this might have skipped the docs too somehow, because I don't know too much about it. But, I'm sure someone will fill in the details I'm missing :).

For now, can you make the change from (1) above? And we'll see if we need other changes as well.

Thanks!

@wouterj
Copy link
Member

wouterj commented Jul 30, 2014

Btw, you also need to add a .. versionadded directive saying that the buildValidation was introduced in Symfony 2.5.

@stof
Copy link
Member

stof commented Sep 12, 2014

@weaverryan the new ExecutionContextInterface extends the deprecated one. And you should still typehint the parent deprcated interface if you want to keep compatibility with the 2.4 API.

@weaverryan
Copy link
Member

Hey @nicolassing!

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