| Total Complexity | 3 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class IterableStringGuard 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 | 4 | public function __construct($input, ?iterable $default = null) |
|
| 30 | { |
||
| 31 | 4 | $this->input = $input; |
|
| 32 | 4 | $this->value = $default; |
|
| 33 | 4 | } |
|
| 34 | |||
| 35 | 3 | protected function extraStringValidation($input): bool |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | protected function validateIterableElement($element, &$value): bool |
|
| 46 |