[Validator] Use the new interface in the README

This commit is contained in:
Ener-Getick 2015-12-21 13:10:36 +01:00
parent 6a92f4e03f
commit 1fbbe84007

View File

@ -18,7 +18,7 @@ use Symfony\Component\Validator\Constraints\Length;
$validator = Validation::createValidator();
$violations = $validator->validateValue('Bernhard', new Length(array('min' => 10)));
$violations = $validator->validate('Bernhard', new Length(array('min' => 10)));
```
This validation will fail because the given string is shorter than ten
@ -46,7 +46,7 @@ $constraint = new Assert\Collection(array(
'password' => new Assert\Length(array('min' => 60)),
));
$violations = $validator->validateValue($input, $constraint);
$violations = $validator->validate($input, $constraint);
```
Again, the validator returns the list of violations.