Skip to content

Commit 730781b

Browse files
javiereguiluzweaverryan
authored andcommitted
Updated the code of the example
1 parent 5909966 commit 730781b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/validator/introduction.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ characters long::
3131

3232
use Symfony\Component\Validator\Validation;
3333
use Symfony\Component\Validator\Constraints\Length;
34+
use Symfony\Component\Validator\Constraints\NotBlank;
3435

3536
$validator = Validation::createValidator();
36-
$violations = $validator->validateValue('Bernhard', new Length(array('min' => 10)));
37+
$violations = $validator->validate('Bernhard', array(
38+
new Length(array('min' => 10)),
39+
new NotBlank()
40+
));
3741

3842
if (0 !== count($violations)) {
3943
// there are errors, now you can show them

0 commit comments

Comments
 (0)