We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 5 |
Paths | 7 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
50 | 11 | public function assert($input): void |
|
51 | { |
||
52 | 11 | if (!$this->isIterable($input)) { |
|
53 | 5 | throw $this->reportError($input); |
|
54 | } |
||
55 | |||
56 | 7 | $exceptions = []; |
|
57 | 7 | foreach ($input as $value) { |
|
58 | try { |
||
59 | 6 | $this->rule->check($value); |
|
60 | 2 | } catch (ValidationException $exception) { |
|
61 | 6 | $exceptions[] = $exception; |
|
62 | } |
||
63 | } |
||
64 | |||
65 | 7 | if (!empty($exceptions)) { |
|
66 | 2 | throw $this->reportError($input)->setRelated($exceptions); |
|
|
|||
67 | } |
||
84 |