We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | 12 | public function validate($input) |
|
| 7 | { |
||
| 8 | 12 | if (! is_string($input) || is_numeric($input)) { |
|
| 9 | 6 | return ($input == true); |
|
| 10 | } |
||
| 11 | |||
| 12 | $validValues = array( |
||
| 13 | 6 | 'on', |
|
| 14 | 6 | 'true', |
|
| 15 | 6 | 'yes', |
|
| 16 | 6 | ); |
|
| 17 | 6 | $filteredInput = strtolower($input); |
|
| 18 | |||
| 19 | 6 | return in_array($filteredInput, $validValues); |
|
| 20 | } |
||
| 21 | } |
||
| 22 |