We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | 22 | public function validate($input) |
|
| 9 | { |
||
| 10 | 22 | if (!is_string($input)) { |
|
| 11 | 7 | return false; |
|
| 12 | } |
||
| 13 | |||
| 14 | 15 | if (0 === strpos($input, '#')) { |
|
| 15 | 11 | $input = substr($input, 1); |
|
| 16 | 11 | } |
|
| 17 | |||
| 18 | 15 | $length = strlen($input); |
|
| 19 | 15 | if ($length != 3 && $length != 6) { |
|
| 20 | 5 | return false; |
|
| 21 | } |
||
| 22 | |||
| 23 | 10 | return parent::validate($input); |
|
| 24 | } |
||
| 25 | } |
||
| 26 |