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