minor #17087 [Validator] Use the new interface in the README (Ener-Getick)

This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Use the new interface in the README

| Q             | A
| ------------- | ---
| Fixed tickets | #17064
| License       | MIT

Commits
-------

1fbbe84 [Validator] Use the new interface in the README
This commit is contained in:
Tobias Schultze 2015-12-21 18:46:54 +01:00
commit 73060e44de

View File

@ -18,7 +18,7 @@ use Symfony\Component\Validator\Constraints\Length;
$validator = Validation::createValidator(); $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 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)), '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. Again, the validator returns the list of violations.