diff --git a/validation.rst b/validation.rst index 55d0c6aaed5..65f174d5094 100644 --- a/validation.rst +++ b/validation.rst @@ -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:: @@ -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