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 | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 23 | public function validate($input) |
|
| 19 | { |
||
| 20 | 23 | if (is_numeric($input)) { |
|
| 21 | 12 | return $input != 0; |
|
| 22 | } |
||
| 23 | |||
| 24 | 16 | if (is_string($input)) { |
|
| 25 | 6 | $input = trim($input); |
|
| 26 | 6 | } |
|
| 27 | |||
| 28 | 16 | if ($input instanceof stdClass) { |
|
| 29 | 2 | $input = (array) $input; |
|
| 30 | 2 | } |
|
| 31 | |||
| 32 | 16 | if (is_array($input)) { |
|
| 33 | 11 | $input = array_filter($input, __METHOD__); |
|
| 34 | 11 | } |
|
| 35 | |||
| 36 | 16 | return !empty($input); |
|
| 37 | } |
||
| 38 | } |
||
| 39 |