We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 7 |
Paths | 11 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 8.4275 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | 1 | public function check($input) |
|
51 | { |
||
52 | 1 | $onePassed = false; |
|
53 | 1 | foreach ($this->getRules() as $v) { |
|
54 | try { |
||
55 | 1 | if ($v->check($input)) { |
|
56 | if (false === $onePassed) { |
||
57 | $onePassed = true; |
||
58 | } else { |
||
59 | return false; |
||
60 | } |
||
61 | } |
||
62 | 1 | } catch (ValidationException $e) { |
|
63 | 1 | if (!isset($firstException)) { |
|
64 | 1 | $firstException = $e; |
|
65 | } |
||
66 | } |
||
67 | } |
||
68 | |||
69 | 1 | if (isset($firstException)) { |
|
70 | 1 | throw $firstException; |
|
71 | } |
||
72 | |||
73 | return $onePassed; |
||
74 | } |
||
75 | } |
||
76 |