Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve ConstraintValidator#buildViolation() documentation #16427

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
m14t opened this issue Nov 2, 2015 · 2 comments
Closed

Improve ConstraintValidator#buildViolation() documentation #16427

m14t opened this issue Nov 2, 2015 · 2 comments
Labels
Enhancement Good first issue Ideal for your first contribution! (some Symfony experience may be required) Validator

Comments

@m14t
Copy link
Contributor

m14t commented Nov 2, 2015

In UPGRADE-3.0.md, it is advised to use buildViolation() instead of addViolationAt(), however as a part of Pull-Request #12016, this method was also marked as depreciated.

What is the preferred way to handle this situation?

@m14t
Copy link
Contributor Author

m14t commented Nov 2, 2015

For my current situation, where I have a class that extends Symfony\Component\Validator\ConstraintValidator all that was needed was to call $this->context->buildViolation instead of $this->buildViolation, but it is I'm not sure if the upgrade documents when $this->context is going to be an instance of ExecutionContextInterface2Dot5 or not.

Also, it seems that FileValidator extends ConstraintValidator, but in several locations it calls $this->buildViolation, which does not seem to exist in Symfony 3.0...

This seem possibly related to c6f1f69 and #13338 (comment)

If someone with more context can add some information as to what the right thing to do is, I'm more than willing to help out here.

@javiereguiluz javiereguiluz added Enhancement Good first issue Ideal for your first contribution! (some Symfony experience may be required) labels Feb 6, 2016
@Flo-Raf
Copy link

Flo-Raf commented Nov 22, 2017

This issue should be closed, because the documentation has been updated.

@xabbuh xabbuh closed this as completed Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Good first issue Ideal for your first contribution! (some Symfony experience may be required) Validator
Projects
None yet
Development

No branches or pull requests

4 participants