Skip to content

[Validator] Make it clear that configuring a constraint doesn't enforce anything #15293

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
Apr 30, 2021
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ order to be valid. These rules are usually defined using PHP code or
annotations but they can also be defined as ``.yaml`` or ``.xml`` files inside
the ``config/validator/`` directory:

For example, to guarantee that the ``$name`` property is not empty, add the
For example, to indicate that the ``$name`` property must not be empty, add the
following:

.. configuration-block::
Expand Down Expand Up @@ -110,6 +110,11 @@ following:
}
}

Adding this configuration by itself does not yet guarantee that the value will
not be blank; you can still set it to a blank value if you want.
To actually guarantee that the value adheres to the constraint, the object must
be passed to the Validator Service to be checked.

.. tip::

Symfony's validator uses PHP reflection, as well as *"getter"* methods, to
Expand Down