We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 5 |
Paths | 9 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
20 | 27 | public function isValid($input): bool |
|
21 | { |
||
22 | 27 | if (is_numeric($input)) { |
|
23 | 14 | return 0 != $input; |
|
24 | } |
||
25 | |||
26 | 20 | if (is_string($input)) { |
|
27 | 9 | $input = trim($input); |
|
28 | } |
||
29 | |||
30 | 20 | if ($input instanceof stdClass) { |
|
31 | 3 | $input = (array) $input; |
|
32 | } |
||
33 | |||
34 | 20 | if (is_array($input)) { |
|
35 | 13 | $input = array_filter($input, __METHOD__); |
|
36 | } |
||
37 | |||
38 | 20 | return !empty($input); |
|
39 | } |
||
41 |