Total Complexity | 5 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
19 | class IterableStringableGuard implements Guard |
||
20 | { |
||
21 | use ErrorMessagesBase; |
||
22 | use SingleIterableInput; |
||
23 | use StringBase { |
||
24 | // Use the iterable's validation as the primary validation logic and rename the string validation method. |
||
25 | SingleIterableInput::validation insteadof StringBase; |
||
26 | StringBase::validation as stringValidation; |
||
27 | } |
||
28 | |||
29 | 5 | public function __construct($input, ?iterable $default = null) |
|
30 | { |
||
31 | 5 | $this->input = $input; |
|
32 | 5 | $this->value = $default; |
|
33 | 5 | } |
|
34 | |||
35 | 4 | protected function extraStringValidation($input): bool |
|
39 | } |
||
40 | |||
41 | 4 | protected function validateIterableElement($element, &$value): bool |
|
46 |