Skip to content

Commit 700747d

Browse files
committed
[Book][Validation] validate method in Validator returns ContraintViolationList object not an array
1 parent 0bcc16b commit 700747d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

book/validation.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ Next, to actually validate an ``Author`` object, use the ``validate`` method
113113
on the ``validator`` service (class :class:`Symfony\\Component\\Validator\\Validator`).
114114
The job of the ``validator`` is easy: to read the constraints (i.e. rules)
115115
of a class and verify whether or not the data on the object satisfies those
116-
constraints. If validation fails, an array of errors is returned. Take this
117-
simple example from inside a controller::
116+
constraints. If validation fails, a non-empty list
117+
(class :class:`Symfony\\Component\\Validator\\ConstraintViolationList`) of errors
118+
is returned. Take this simple example from inside a controller::
118119

119120
// ...
120121
use Symfony\Component\HttpFoundation\Response;

0 commit comments

Comments
 (0)