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 custom_constraint.rst #10671

Closed
wants to merge 1 commit into from

Conversation

thomasbisignani
Copy link
Contributor

Just added the constraint check to limit the ContainsAlphanumericValidator use with the ContainsAlphanumeric constraint.

@@ -65,6 +65,10 @@ The validator class is also simple, and only has one required method ``validate(
{
public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof ContainsAlphanumeric) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe \assert($constraint instanceof ContainsAlphanumeric) would be a better fit here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inline with how all core validators are implemented.

@xabbuh xabbuh added this to the 2.8 milestone Nov 14, 2018
@javiereguiluz
Copy link
Member

Thanks Thomas.

javiereguiluz added a commit that referenced this pull request Nov 14, 2018
This PR was submitted for the 4.1 branch but it was merged into the 2.8 branch instead (closes #10671).

Discussion
----------

Update custom_constraint.rst

Just added the constraint check to limit the `ContainsAlphanumericValidator` use with the `ContainsAlphanumeric` constraint.

Commits
-------

bb30126 Update custom_constraint.rst
@thomasbisignani thomasbisignani deleted the patch-2 branch November 14, 2018 16:51
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