Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
15 | public function suggest(string $q, int $limit = 5): array |
||
16 | { |
||
17 | $result = 'unknown'; |
||
18 | switch ($q) { |
||
19 | case 'webmister': |
||
20 | $result = 'webmaster'; |
||
21 | |||
22 | break; |
||
23 | } |
||
24 | |||
25 | if (\sizeof($result) > $limit) { |
||
|
|||
26 | $result = \array_slice($result, 0, $limit); |
||
27 | } |
||
28 | |||
29 | return $result; |
||
30 | } |
||
32 |