Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function check($value): bool |
||
28 | { |
||
29 | $names = explode(' ', $value); |
||
30 | |||
31 | // Each name must be at least 2 characters long. |
||
32 | foreach ($names as $name) { |
||
33 | if (mb_strlen($name) < 2) { |
||
34 | return false; |
||
35 | } |
||
36 | } |
||
37 | |||
38 | // Name cannot be longer shorter than 6 characters. |
||
39 | return mb_strlen($value) >= 6; |
||
40 | } |
||
42 |