1 | <?php |
||
7 | class Builder |
||
8 | { |
||
9 | /** |
||
10 | * Get all allowed languages. |
||
11 | * |
||
12 | * @return array |
||
13 | */ |
||
14 | public static function allowedLanguages() |
||
22 | |||
23 | /** |
||
24 | * Returns add names for arrays with only codes an return an array as [$code => $language]. |
||
25 | * |
||
26 | * @param array $langs |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | public static function addNames($langs) |
||
53 | |||
54 | /** |
||
55 | * Returns an string url to set up language. |
||
56 | * |
||
57 | * @param string $code |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public static function setRoute($code) |
||
65 | |||
66 | /** |
||
67 | * Returns the current language code. |
||
68 | * |
||
69 | * @param string $ucfirst |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public static function getCurrentCode($ucfirst = false) |
||
81 | |||
82 | /** |
||
83 | * Returns the current language name. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | public static function getCurrentLanguage() |
||
91 | |||
92 | /** |
||
93 | * Returns the language name. |
||
94 | * |
||
95 | * @param string $code |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public static function getLanguage($code) |
||
103 | } |
||
104 |
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: