| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | trait TCheckArrayString |
||
| 15 | { |
||
| 16 | use TRule; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param mixed|null $againstValue |
||
| 20 | * @throws RuleException |
||
| 21 | * @return array<string> |
||
| 22 | */ |
||
| 23 | 21 | protected function checkValue($againstValue) |
|
| 24 | { |
||
| 25 | 21 | if (!is_array($againstValue)) { |
|
| 26 | 5 | throw new RuleException('No array found. Need set input as array!'); |
|
| 27 | } |
||
| 28 | 16 | return array_map([$this, 'checkRule'], $againstValue); |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param mixed|null $singleRule |
||
| 33 | * @throws RuleException |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | 12 | protected function checkRule($singleRule): string |
|
| 45 | } |
||
| 46 | } |
||
| 47 |