Skip to content

Tweak the IsTrue validation docs #12712

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

Merged
merged 1 commit into from
Nov 30, 2019

Conversation

javiereguiluz
Copy link
Member

Please review that this is correct: IsTrue requires that method names start with "is" or "get" Thanks!

@@ -113,7 +112,9 @@ Then you can constrain this method with ``IsTrue``.
}
}

If the ``isTokenValid()`` returns false, the validation will fail.
If the ``isTokenValid()`` returns false, the validation will fail. When applied
to methods, this constraint requires method names to start with ``is`` or
Copy link
Member

Choose a reason for hiding this comment

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

This does not look right to me. Is this based on some bug report?

Copy link
Member Author

Choose a reason for hiding this comment

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

The original doc said that this works with "a "getter" method" But what's that? Only getters? Because I know that it works for issers too ... so, getters + issers only? Or does this work with ANY kind of method regardless of its name? Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

This works with an method that returns a boolean value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for clarifying this. I've updated the description.

javiereguiluz added a commit that referenced this pull request Nov 30, 2019
This PR was squashed before being merged into the 3.4 branch (closes #12712).

Discussion
----------

Tweak the IsTrue validation docs

Please review that this is correct: *IsTrue requires that method names start with "is" or "get"* Thanks!

Commits
-------

c47d8ae Tweak the IsTrue validation docs
@javiereguiluz javiereguiluz merged commit c47d8ae into symfony:3.4 Nov 30, 2019
@javiereguiluz javiereguiluz deleted the is_true_constraint branch November 30, 2019 16:58
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