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

[Validator] Added the missing constraints instance checks #29223

Conversation

thomasbisignani
Copy link
Contributor

Q A
Branch? 2.8
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

This PR adds the constraints instance checks missing to limit the validators use.

This behavior is already implemented in all built-in validators, but it was missed in two validators.

@ro0NL
Copy link
Contributor

ro0NL commented Nov 14, 2018

i think we should target master for this, as a new feature. IMHO a deprecation is not really worth it, so 👍 for throwing.

@stof
Copy link
Member

stof commented Nov 14, 2018

Well, the code of the validator already expects the right class due to property being used. So these are about providing a good error message in case you mess your project configuration, but it probably already does not work (with a crappier error message) in case of such mess.
So 👍 for adding the exception directly.

@ro0NL
Copy link
Contributor

ro0NL commented Nov 14, 2018

@stof unless someone completely mimics the exepcted api with its own constraint class :}

@nicolas-grekas
Copy link
Member

Thank you @thomasbisignani.

@nicolas-grekas nicolas-grekas merged commit 0ecaead into symfony:2.8 Nov 15, 2018
nicolas-grekas added a commit that referenced this pull request Nov 15, 2018
…(thomasbisignani)

This PR was merged into the 2.8 branch.

Discussion
----------

[Validator] Added the missing constraints instance checks

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This PR adds the constraints instance checks missing to limit the validators use.

This behavior is already implemented in all built-in validators, but it was missed in two validators.

Commits
-------

0ecaead [Validator] Added the missing constraints instance checks
@fabpot fabpot mentioned this pull request Nov 16, 2018
This was referenced Nov 26, 2018
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.

None yet

5 participants