| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.128 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 2 | protected function validateValue($value, DataSetInterface $dataSet = null): Result |
|
| 33 | { |
||
| 34 | 2 | $result = new Result(); |
|
| 35 | 2 | if (!is_iterable($value)) { |
|
| 36 | $result->addError(new ErrorMessage($this->incorrectInputMessage)); |
||
| 37 | return $result; |
||
| 38 | } |
||
| 39 | |||
| 40 | 2 | foreach ($value as $item) { |
|
| 41 | 2 | $itemResult = $this->rules->validate($item, $dataSet); |
|
| 42 | 2 | if ($itemResult->isValid() === false) { |
|
| 43 | 2 | $result->addResultWithWrapper($itemResult, $this->message, ['value' => $item]); |
|
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | 2 | return $result; |
|
| 48 | } |
||
| 62 |