From 700747d9bce25b5fa9ac699546c33ae95ab28108 Mon Sep 17 00:00:00 2001 From: Zbigniew Czapran Date: Wed, 11 Dec 2013 17:10:39 +0100 Subject: [PATCH 1/2] [Book][Validation] validate method in Validator returns ContraintViolationList object not an array --- book/validation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/book/validation.rst b/book/validation.rst index a6ec3bebe0c..45c1027385f 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -113,8 +113,9 @@ Next, to actually validate an ``Author`` object, use the ``validate`` method on the ``validator`` service (class :class:`Symfony\\Component\\Validator\\Validator`). The job of the ``validator`` is easy: to read the constraints (i.e. rules) of a class and verify whether or not the data on the object satisfies those -constraints. If validation fails, an array of errors is returned. Take this -simple example from inside a controller:: +constraints. If validation fails, a non-empty list +(class :class:`Symfony\\Component\\Validator\\ConstraintViolationList`) of errors +is returned. Take this simple example from inside a controller:: // ... use Symfony\Component\HttpFoundation\Response; From 1b0e32b92926d21f64baab04bde0f551414bf63f Mon Sep 17 00:00:00 2001 From: Zbigniew Czapran Date: Wed, 11 Dec 2013 17:32:17 +0100 Subject: [PATCH 2/2] applies WouterJ suggestion --- book/validation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/validation.rst b/book/validation.rst index 45c1027385f..8809fa60be8 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -113,9 +113,9 @@ Next, to actually validate an ``Author`` object, use the ``validate`` method on the ``validator`` service (class :class:`Symfony\\Component\\Validator\\Validator`). The job of the ``validator`` is easy: to read the constraints (i.e. rules) of a class and verify whether or not the data on the object satisfies those -constraints. If validation fails, a non-empty list -(class :class:`Symfony\\Component\\Validator\\ConstraintViolationList`) of errors -is returned. Take this simple example from inside a controller:: +constraints. If validation fails, a non-empty list of errors +(class :class:`Symfony\\Component\\Validator\\ConstraintViolationList`) is +returned. Take this simple example from inside a controller: // ... use Symfony\Component\HttpFoundation\Response;