From 9eea3d8f8a310168878cd94e2256909945504a19 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Fri, 1 Jun 2018 17:14:37 +0200 Subject: [PATCH 1/2] fix(Caution): Validator folder for YAML or XML format The validator waits for a `config/validator` folder structure if we use the "file" approach, this structure must be respected. --- validation.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validation.rst b/validation.rst index de15cd21619..d4f4b0632db 100644 --- a/validation.rst +++ b/validation.rst @@ -113,6 +113,11 @@ following: Protected and private properties can also be validated, as well as "getter" methods (see :ref:`validator-constraint-targets`). +.. caution:: + + If you're using the YAML or XML formats, the ``config/validator`` folder + structure should be respected ! + .. index:: single: Validation; Using the validator From a945038c7481d90dce973d9bcafb17a8afdfa682 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 1 Jun 2018 17:26:47 +0200 Subject: [PATCH 2/2] Reword --- validation.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/validation.rst b/validation.rst index d4f4b0632db..3ac34c2ef74 100644 --- a/validation.rst +++ b/validation.rst @@ -43,8 +43,9 @@ So far, this is just an ordinary class that serves some purpose inside your application. The goal of validation is to tell you if the data of an object is valid. For this to work, you'll configure a list of rules (called :ref:`constraints `) that the object must -follow in order to be valid. These rules can be specified via a number of -different formats (YAML, XML, annotations, or PHP). +follow in order to be valid. These rules are usually defined using PHP code or +annotations but they can also be defined as a ``validation.yaml`` or +``validation.xml`` file inside the ``config/validator/`` directory: For example, to guarantee that the ``$name`` property is not empty, add the following: @@ -113,11 +114,6 @@ following: Protected and private properties can also be validated, as well as "getter" methods (see :ref:`validator-constraint-targets`). -.. caution:: - - If you're using the YAML or XML formats, the ``config/validator`` folder - structure should be respected ! - .. index:: single: Validation; Using the validator