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 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
16 | 22 | public function validate($input) |
|
17 | { |
||
18 | 22 | if (!is_string($input)) { |
|
19 | 7 | return false; |
|
20 | } |
||
21 | |||
22 | 15 | if (0 === strpos($input, '#')) { |
|
23 | 11 | $input = substr($input, 1); |
|
24 | 11 | } |
|
25 | |||
26 | 15 | $length = strlen($input); |
|
27 | 15 | if ($length != 3 && $length != 6) { |
|
28 | 5 | return false; |
|
29 | } |
||
30 | |||
31 | 10 | return parent::validate($input); |
|
32 | } |
||
33 | } |
||
34 |