77
88interface ChainedValidatorInterface
99{
10- /**
11- * @throws ValidationException
12- */
13- public function assert (mixed $ value , string $ name ): void ;
14-
15- public function validate (mixed $ value ): bool ;
16-
17- // --- Rules ---
18-
19- public function all (
20- array $ constraints ,
21- string $ message = 'At "{{ key }}": {{ message }} '
22- ): ChainedValidatorInterface ;
23-
2410 public function choice (
2511 array $ constraints ,
2612 bool $ multiple = false ,
@@ -30,54 +16,61 @@ public function choice(
3016 string $ multipleMessage = 'The "{{ name }}" value has one or more invalid choices, "{{ value }}" given. Accepted values are: "{{ constraints }}". ' ,
3117 string $ minMessage = 'The "{{ name }}" value must have at least {{ minConstraint }} choices, {{ numValues }} choices given. ' ,
3218 string $ maxMessage = 'The "{{ name }}" value must have at most {{ maxConstraint }} choices, {{ numValues }} choices given. '
33- ): ChainedValidatorInterface ;
19+ ): ChainedValidatorInterface & Validator ;
3420
3521 public function country (
3622 string $ code = 'alpha-2 ' ,
3723 string $ message = 'The "{{ name }}" value is not a valid "{{ code }}" country code, "{{ value }}" given. '
38- ): ChainedValidatorInterface ;
24+ ): ChainedValidatorInterface &Validator ;
25+
26+ public function eachValue (
27+ Validator $ validator ,
28+ string $ message = 'At key "{{ key }}": {{ message }} '
29+ ): ChainedValidatorInterface &Validator ;
3930
4031 public function greaterThan (
4132 mixed $ constraint ,
4233 string $ message = 'The "{{ name }}" value should be greater than "{{ constraint }}", "{{ value }}" given. '
43- ): ChainedValidatorInterface ;
34+ ): ChainedValidatorInterface & Validator ;
4435
4536 public function greaterThanOrEqual (
4637 mixed $ constraint ,
4738 string $ message = 'The "{{ name }}" value should be greater than or equal to "{{ constraint }}", "{{ value }}" given. '
48- ): ChainedValidatorInterface ;
39+ ): ChainedValidatorInterface & Validator ;
4940
5041 public function lessThan (
5142 mixed $ constraint ,
5243 string $ message = 'The "{{ name }}" value should be less than "{{ constraint }}", "{{ value }}" given. '
53- ): ChainedValidatorInterface ;
44+ ): ChainedValidatorInterface & Validator ;
5445
5546 public function lessThanOrEqual (
5647 mixed $ constraint ,
5748 string $ message = 'The "{{ name }}" value should be less than or equal to "{{ constraint }}", "{{ value }}" given. '
58- ): ChainedValidatorInterface ;
49+ ): ChainedValidatorInterface & Validator ;
5950
6051 public function notBlank (
6152 ?callable $ normalizer = null ,
6253 string $ message = 'The "{{ name }}" value should not be blank, "{{ value }}" given. '
63- ): ChainedValidatorInterface ;
54+ ): ChainedValidatorInterface & Validator ;
6455
6556 public function range (
6657 mixed $ minConstraint ,
6758 mixed $ maxConstraint ,
6859 string $ message = 'The "{{ name }}" value should be between "{{ minConstraint }}" and "{{ maxConstraint }}", "{{ value }}" given. '
69- ): ChainedValidatorInterface ;
60+ ): ChainedValidatorInterface & Validator ;
7061
71- public function rule (RuleInterface $ constraint ): ChainedValidatorInterface ;
62+ public function rule (
63+ RuleInterface $ constraint
64+ ): ChainedValidatorInterface &Validator ;
7265
7366 public function timezone (
7467 int $ timezoneGroup = \DateTimeZone::ALL ,
7568 ?string $ countryCode = null ,
7669 string $ message = 'The "{{ name }}" value is not a valid timezone, "{{ value }}" given. '
77- ): ChainedValidatorInterface ;
70+ ): ChainedValidatorInterface & Validator ;
7871
7972 public function type (
8073 string |array $ constraint ,
8174 string $ message = 'The "{{ name }}" value should be of type "{{ constraint }}", "{{ value }}" given. '
82- ): ChainedValidatorInterface ;
75+ ): ChainedValidatorInterface & Validator ;
8376}
0 commit comments