Total Complexity | 2 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class StringUtils |
||
10 | { |
||
11 | /** |
||
12 | * Returns length of multibyte string |
||
13 | * |
||
14 | * @param string $string |
||
15 | * @param string $encoding |
||
16 | * |
||
17 | * @return int |
||
18 | */ |
||
19 | public static function length(string $string, string $encoding = Constraints::UTF_8): int |
||
20 | { |
||
21 | return mb_strlen($string, $encoding); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Checks if multibyte string is empty |
||
26 | * |
||
27 | * @param string $string |
||
28 | * @param string $encoding |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | public static function isEmpty(string $string, string $encoding = Constraints::UTF_8): bool |
||
35 | } |
||
36 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.