Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class RegexRule implements RuleInterface |
||
10 | { |
||
11 | /** |
||
12 | * {@inheritdoc} |
||
13 | */ |
||
14 | public function run($value, array $input, array $args): bool |
||
15 | { |
||
16 | return (bool)preg_match($args[0], $value); |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | public function errorMessage(): string |
||
23 | { |
||
24 | return 'Field `{field}` was not in the correct format.'; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function canSkip(): bool |
||
33 | } |
||
34 | } |