We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 9 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6.0359 |
Changes | 0 |
1 | <?php |
||
42 | 2 | public function check($input) |
|
43 | { |
||
44 | 2 | foreach ($this->getRules() as $v) { |
|
45 | try { |
||
46 | 2 | if ($v->check($input)) { |
|
47 | 1 | return true; |
|
48 | } |
||
49 | 2 | } catch (ValidationException $e) { |
|
50 | 2 | if (!isset($firstException)) { |
|
51 | 2 | $firstException = $e; |
|
52 | } |
||
53 | } |
||
54 | } |
||
55 | |||
56 | 1 | if (isset($firstException)) { |
|
57 | 1 | throw $firstException; |
|
58 | } |
||
59 | |||
60 | return false; |
||
61 | } |
||
62 | } |
||
63 |