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

Commit 6aef764

Browse files
committed
chore: added Country rule to interfaces
1 parent a3338c2 commit 6aef764

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/ChainedValidatorInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public function choice(
3232
string $maxMessage = 'The "{{ name }}" value must have at most {{ maxConstraint }} choices, {{ numValues }} choices given.'
3333
): ChainedValidatorInterface;
3434

35+
public function country(
36+
string $code = 'alpha-2',
37+
string $message = 'The "{{ name }}" value is not a valid country code, "{{ value }}" given.'
38+
): ChainedValidatorInterface;
39+
3540
public function greaterThan(
3641
mixed $constraint,
3742
string $message = 'The "{{ name }}" value should be greater than "{{ constraint }}", "{{ value }}" given.'

src/StaticValidatorInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public static function choice(
2222
string $maxMessage = 'The "{{ name }}" value must have at most {{ maxConstraint }} choices, {{ numValues }} choices given.'
2323
): ChainedValidatorInterface;
2424

25+
public static function country(
26+
string $code = 'alpha-2',
27+
string $message = 'The "{{ name }}" value is not a valid country code, "{{ value }}" given.'
28+
): ChainedValidatorInterface;
29+
2530
public static function greaterThan(
2631
mixed $constraint,
2732
string $message = 'The "{{ name }}" value should be greater than "{{ constraint }}", "{{ value }}" given.'

0 commit comments

Comments
 (0)