Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 16 | public function canonicalize($string) |
|
24 | { |
||
25 | 16 | if (null === $string) { |
|
26 | 1 | return; |
|
27 | } |
||
28 | 16 | $encoding = mb_detect_encoding($string, mb_detect_order(), true); |
|
29 | |||
30 | 16 | return $encoding |
|
31 | 16 | ? mb_convert_case($string, MB_CASE_LOWER, $encoding) |
|
32 | 16 | : mb_convert_case($string, MB_CASE_LOWER); |
|
33 | } |
||
35 |