Conditions | 8 |
Paths | 7 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 8.0291 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 25 | public function getFileName($countryCallingCode, $language, $script, $region) |
|
|
|||
24 | { |
||
25 | 25 | if (strlen($language) == 0) { |
|
26 | return ""; |
||
27 | } |
||
28 | |||
29 | 25 | if ($language === 'zh' && ($region == 'TW' || $region == 'HK' || $region == 'MO')) { |
|
30 | 1 | $language = 'zh_Hant'; |
|
31 | 1 | } |
|
32 | |||
33 | // Loop through the $countryCallingCode and load the prefix |
||
34 | 25 | $prefixLength = strlen($countryCallingCode); |
|
35 | |||
36 | 25 | for ($i = $prefixLength; $i > 0; $i--) { |
|
37 | 25 | $prefix = substr($countryCallingCode, 0, $i); |
|
38 | 25 | if ($this->inMap($language, $prefix)) { |
|
39 | 21 | return $language . DIRECTORY_SEPARATOR . $prefix . '.php'; |
|
40 | } |
||
41 | 25 | } |
|
42 | |||
43 | 9 | return ""; |
|
44 | } |
||
45 | |||
51 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.