8000 [Validation] Add "hasser" support by bicpi · Pull Request #3418 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Validation] Add "hasser" support #3418

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 3 commits into from
Mar 26, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add "versionadded" directive for 2.5
  • Loading branch information
bicpi committed Jan 4, 2014
commit bb9004ef6cd181fd7fba1f6d7dae1e2c5e129b3f
3 changes: 3 additions & 0 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ allows you to add a constraint to any public method whose name starts with
"get", "is" or "has". In this guide, these types of methods are referred to
as "getters".
Copy link
Member

Choose a reason for hiding this comment

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

we need a versionadded directive for the "hasser" support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added this yesterday, see commit below.


.. versionadded:: 2.5
Support for methods starting with ``has`` is new in Symfony 2.5.
Copy link
Member

Choose a reason for hiding this comment

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

was introduced in Symfony 2.5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it makes sense to also fix the wording in 2.3 and 2.4, or is it a new convention?

Copy link
Member

Choose a reason for hiding this comment

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

it's a new convention and as the versionadded directives are removed quite quickly, we decided not to invest time in updating the others. We can better document the missing things! 👏


The benefit of this technique is that it allows you to validate your object
dynamically. For example, suppose you want to make sure that a password field
doesn't match the first name of the user (for security reasons). You can
Expand Down
0