Conditions | 4 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function getLanguageName($isoCode, $locale = null) |
||
41 | { |
||
42 | if ($isoCode === null) { |
||
43 | return; |
||
44 | } |
||
45 | if ($locale) { |
||
|
|||
46 | \Locale::setDefault($locale); |
||
47 | } |
||
48 | $language = explode('_', $isoCode); |
||
49 | |||
50 | return isset($language[1]) |
||
51 | ? Intl::getLanguageBundle()->getLanguageName($language[0], $language[1]) |
||
52 | : Intl::getLanguageBundle()->getLanguageName($language[0]); |
||
53 | } |
||
54 | |||
60 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: