Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbce5a2

Browse files
committed
[Validator] Updated outdated doc blocks
1 parent 8558377 commit dbce5a2

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/Symfony/Component/Validator/Constraints/GroupSequence.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* When validating a group sequence, each group will only be validated if all
2020
* of the previous groups in the sequence succeeded. For example:
2121
*
22-
* $validator->validateObject($address, new GroupSequence('Basic', 'Strict'));
22+
* $validator->validate($address, new Valid(), new GroupSequence('Basic', 'Strict'));
2323
*
2424
* In the first step, all constraints that belong to the group "Basic" will be
2525
* validated. If none of the constraints fail, the validator will then validate
@@ -42,12 +42,12 @@
4242
* Whenever you validate that object in the "Default" group, the group sequence
4343
* will be validated:
4444
*
45-
* $validator->validateObject($address);
45+
* $validator->validate($address, new Valid());
4646
*
4747
* If you want to execute the constraints of the "Default" group for a class
4848
* with an overridden default group, pass the class name as group name instead:
4949
*
50-
* $validator->validateObject($address, "Address")
50+
* $validator->validate($address, new Valid(), "Address")
5151
*
5252
* @Annotation
5353
*

src/Symfony/Component/Validator/Context/ExecutionContextInterface.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111

1212
namespace Symfony\Component\Validator\Context;
1313

14-
use Symfony\Component\Validator\Constraints\GroupSequence;
15-
use Symfony\Component\Validator\ConstraintViolationListInterface;
1614
use Symfony\Component\Validator\ExecutionContextInterface as LegacyExecutionContextInterface;
17-
use Symfony\Component\Validator\Mapping\MetadataInterface;
1815
use Symfony\Component\Validator\Validator\ValidatorInterface;
1916
use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface;
2017

@@ -24,7 +21,7 @@
2421
* The context collects all violations generated during the validation. By
2522
* default, validators execute all validations in a new context:
2623
*
27-
* $violations = $validator->validateObject($object);
24+
* $violations = $validator->validate($object);
2825
*
2926
* When you make another call to the validator, while the validation is in
3027
* progress, the violations will be isolated from each other:
@@ -34,7 +31,7 @@
3431
* $validator = $this->context->getValidator();
3532
*
3633
* // The violations are not added to $this->context
37-
* $violations = $validator->validateObject($value);
34+
* $violations = $validator->validate($value);
3835
* }
3936
*
4037
* However, if you want to add the violations to the current context, use the
@@ -47,7 +44,7 @@
4744
* // The violations are added to $this->context
4845
* $validator
4946
* ->inContext($this->context)
50-
* ->validateObject($value)
47+
* ->validate($value)
5148
* ;
5249
* }
5350
*

0 commit comments

Comments
 (0)