[Validator] Updated outdated doc blocks

This commit is contained in:
Bernhard Schussek 2014-02-20 21:27:30 +01:00
parent 8558377945
commit dbce5a2f6a
2 changed files with 6 additions and 9 deletions

View File

@ -19,7 +19,7 @@ use Symfony\Component\Validator\Exception\OutOfBoundsException;
* When validating a group sequence, each group will only be validated if all
* of the previous groups in the sequence succeeded. For example:
*
* $validator->validateObject($address, new GroupSequence('Basic', 'Strict'));
* $validator->validate($address, new Valid(), new GroupSequence('Basic', 'Strict'));
*
* In the first step, all constraints that belong to the group "Basic" will be
* validated. If none of the constraints fail, the validator will then validate
@ -42,12 +42,12 @@ use Symfony\Component\Validator\Exception\OutOfBoundsException;
* Whenever you validate that object in the "Default" group, the group sequence
* will be validated:
*
* $validator->validateObject($address);
* $validator->validate($address, new Valid());
*
* If you want to execute the constraints of the "Default" group for a class
* with an overridden default group, pass the class name as group name instead:
*
* $validator->validateObject($address, "Address")
* $validator->validate($address, new Valid(), "Address")
*
* @Annotation
*

View File

@ -11,10 +11,7 @@
namespace Symfony\Component\Validator\Context;
use Symfony\Component\Validator\Constraints\GroupSequence;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Component\Validator\ExecutionContextInterface as LegacyExecutionContextInterface;
use Symfony\Component\Validator\Mapping\MetadataInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
@ -24,7 +21,7 @@ use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
* The context collects all violations generated during the validation. By
* default, validators execute all validations in a new context:
*
* $violations = $validator->validateObject($object);
* $violations = $validator->validate($object);
*
* When you make another call to the validator, while the validation is in
* progress, the violations will be isolated from each other:
@ -34,7 +31,7 @@ use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
* $validator = $this->context->getValidator();
*
* // The violations are not added to $this->context
* $violations = $validator->validateObject($value);
* $violations = $validator->validate($value);
* }
*
* However, if you want to add the violations to the current context, use the
@ -47,7 +44,7 @@ use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
* // The violations are added to $this->context
* $validator
* ->inContext($this->context)
* ->validateObject($value)
* ->validate($value)
* ;
* }
*