Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit e3ea76e

Browse files
committed
fix: EachValue message option default value and interfaces
1 parent e8f9c6b commit e3ea76e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

docs/03x-rules-eachvalue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Validator that will validate each element of an `array` or object implementing `
2929

3030
### `message`
3131

32-
type: `string` default: `At "{{ key }}": {{ message }}`
32+
type: `string` default: `At key "{{ key }}": {{ message }}`
3333

3434
Message that will be shown if at least one input value element is invalid according to the given `validator`.
3535

src/ChainedValidatorInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public function validate(mixed $value): bool;
1616

1717
// --- Rules ---
1818

19-
public function all(
20-
array $constraints,
21-
string $message = 'At "{{ key }}": {{ message }}'
22-
): ChainedValidatorInterface;
23-
2419
public function choice(
2520
array $constraints,
2621
bool $multiple = false,
@@ -37,6 +32,11 @@ public function country(
3732
string $message = 'The "{{ name }}" value is not a valid "{{ code }}" country code, "{{ value }}" given.'
3833
): ChainedValidatorInterface;
3934

35+
public function eachValue(
36+
Validator $validator,
37+
string $message = 'At key "{{ key }}": {{ message }}'
38+
): ChainedValidatorInterface;
39+
4040
public function greaterThan(
4141
mixed $constraint,
4242
string $message = 'The "{{ name }}" value should be greater than "{{ constraint }}", "{{ value }}" given.'

src/StaticValidatorInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
interface StaticValidatorInterface
88
{
9-
public static function all(
10-
array $constraints,
11-
string $message = 'At "{{ key }}": {{ message }}'
12-
): ChainedValidatorInterface;
13-
149
public static function choice(
1510
array $constraints,
1611
bool $multiple = false,
@@ -27,6 +22,11 @@ public static function country(
2722
string $message = 'The "{{ name }}" value is not a valid "{{ code }}" country code, "{{ value }}" given.'
2823
): ChainedValidatorInterface;
2924

25+
public static function eachValue(
26+
Validator $validator,
27+
string $message = 'At key "{{ key }}": {{ message }}'
28+
): ChainedValidatorInterface;
29+
3030
public static function greaterThan(
3131
mixed $constraint,
3232
string $message = 'The "{{ name }}" value should be greater than "{{ constraint }}", "{{ value }}" given.'

0 commit comments

Comments
 (0)