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 | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
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 | foreach ($input as $value) { |
|
57 | try { |
||
58 | 6 | $this->rule->check($value); |
|
59 | 2 | } catch (ValidationException $exception) { |
|
60 | 6 | $exceptions[] = $exception; |
|
61 | } |
||
62 | } |
||
63 | |||
64 | 7 | if (!empty($exceptions)) { |
|
65 | 2 | throw $this->reportError($input)->setRelated($exceptions); |
|
|
|||
66 | } |
||
83 |