@@ -183,6 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | 185 | * Gets the CultureInfo that for this culture string |
| 186 | + * @param string $culture |
|
| 186 | 187 | * @return CultureInfo invariant culture info is "en". |
| 187 | 188 | */ |
| 188 | 189 | public static function getInstance($culture) |
@@ -208,6 +209,7 @@ discard block |
||
| 208 | 209 | * Set the culture for the current instance. The culture indentifier |
| 209 | 210 | * must be of the form "<language>_(country/region)". |
| 210 | 211 | * @param string culture identifier, e.g. "fr_FR". |
| 212 | + * @param string $culture |
|
| 211 | 213 | */ |
| 212 | 214 | protected function setCulture($culture) |
| 213 | 215 | { |
@@ -223,6 +225,7 @@ discard block |
||
| 223 | 225 | /** |
| 224 | 226 | * Load the ICU culture data resource bundles for the specific culture identifier. |
| 225 | 227 | * @param string the culture identifier. |
| 228 | + * @param string $cultureName |
|
| 226 | 229 | */ |
| 227 | 230 | protected function loadCultureData($cultureName) |
| 228 | 231 | { |
@@ -266,6 +269,7 @@ discard block |
||
| 266 | 269 | * currency for "en_AU", you need to use findInfo("Currencies,true);. |
| 267 | 270 | * @param string the data you want to find. |
| 268 | 271 | * @param boolean merge the data from its parents. |
| 272 | + * @param string $key |
|
| 269 | 273 | * @return mixed the specific ICU data. |
| 270 | 274 | */ |
| 271 | 275 | public function findInfo($path='/', $merge=false, $key = null) |
@@ -358,6 +362,7 @@ discard block |
||
| 358 | 362 | /** |
| 359 | 363 | * Set the date time format information. |
| 360 | 364 | * @param DateTimeFormatInfo the new date time format info. |
| 365 | + * @param DateTimeFormatInfo $dateTimeFormat |
|
| 361 | 366 | */ |
| 362 | 367 | public function setDateTimeFormat($dateTimeFormat) |
| 363 | 368 | { |
@@ -457,6 +462,7 @@ discard block |
||
| 457 | 462 | /** |
| 458 | 463 | * Set the number format information. |
| 459 | 464 | * @param NumberFormatInfo the new number format info. |
| 465 | + * @param NumberFormatInfo $numberFormat |
|
| 460 | 466 | */ |
| 461 | 467 | public function setNumberFormat($numberFormat) |
| 462 | 468 | { |
@@ -595,7 +601,7 @@ discard block |
||
| 595 | 601 | |
| 596 | 602 | /** |
| 597 | 603 | * Get a list of timezones in the language of the localized version. |
| 598 | - * @return array list of localized timezones. |
|
| 604 | + * @return string[] list of localized timezones. |
|
| 599 | 605 | */ |
| 600 | 606 | public function getTimeZones() |
| 601 | 607 | { |
@@ -121,6 +121,7 @@ discard block |
||
| 121 | 121 | * unless you know what you are doing. Please use use |
| 122 | 122 | * DateTimeFormatInfo::getInstance() to create an instance. |
| 123 | 123 | * @param array ICU data for date time formatting. |
| 124 | + * @param CultureInfo $cultureInfo |
|
| 124 | 125 | * @see getInstance() |
| 125 | 126 | */ |
| 126 | 127 | public function __construct($cultureInfo) |
@@ -170,6 +171,9 @@ discard block |
||
| 170 | 171 | } |
| 171 | 172 | } |
| 172 | 173 | |
| 174 | + /** |
|
| 175 | + * @param string $path |
|
| 176 | + */ |
|
| 173 | 177 | public function getInfoByPath($path) |
| 174 | 178 | { |
| 175 | 179 | static $basePath = null; |
@@ -262,6 +266,7 @@ discard block |
||
| 262 | 266 | /** |
| 263 | 267 | * A string containing the name of the era. |
| 264 | 268 | * @param int era The integer representing the era. |
| 269 | + * @param integer $era |
|
| 265 | 270 | * @return string the era name. |
| 266 | 271 | */ |
| 267 | 272 | public function getEra($era) |
@@ -109,6 +109,7 @@ discard block |
||
| 109 | 109 | * class directly unless you know what you are doing. Please use use |
| 110 | 110 | * NumberFormatInfo::getInstance() to create an instance. |
| 111 | 111 | * @param array ICU data for date time formatting. |
| 112 | + * @param CultureInfo $cultureInfo |
|
| 112 | 113 | * @see getInstance() |
| 113 | 114 | */ |
| 114 | 115 | public function __construct($cultureInfo, $type = NumberFormatInfo::DECIMAL) |
@@ -123,6 +124,9 @@ discard block |
||
| 123 | 124 | $this->setPattern($type); |
| 124 | 125 | } |
| 125 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $path |
|
| 129 | + */ |
|
| 126 | 130 | public function getInfoByPath($path) |
| 127 | 131 | { |
| 128 | 132 | static $basePath = null; |
@@ -175,6 +179,7 @@ discard block |
||
| 175 | 179 | * @param int the number formatting type, it should be |
| 176 | 180 | * NumberFormatInfo::DECIMAL, NumberFormatInfo::CURRENCY, |
| 177 | 181 | * NumberFormatInfo::PERCENTAGE, or NumberFormatInfo::SCIENTIFIC |
| 182 | + * @param string $type |
|
| 178 | 183 | * @return NumberFormatInfo NumberFormatInfo for the specified |
| 179 | 184 | * culture. |
| 180 | 185 | * @see getCurrencyInstance(); |
@@ -53,24 +53,24 @@ discard block |
||
| 53 | 53 | $this->languages = array(); |
| 54 | 54 | |
| 55 | 55 | if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) |
| 56 | - return $this->languages; |
|
| 56 | + return $this->languages; |
|
| 57 | 57 | |
| 58 | 58 | $info = new CultureInfo(); |
| 59 | 59 | |
| 60 | 60 | foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) |
| 61 | 61 | { |
| 62 | - // Cut off any q-value that might come after a semi-colon |
|
| 63 | - if ($pos = strpos($lang, ';')) |
|
| 64 | - $lang = trim(substr($lang, 0, $pos)); |
|
| 62 | + // Cut off any q-value that might come after a semi-colon |
|
| 63 | + if ($pos = strpos($lang, ';')) |
|
| 64 | + $lang = trim(substr($lang, 0, $pos)); |
|
| 65 | 65 | |
| 66 | 66 | if (strstr($lang, '-')) |
| 67 | 67 | { |
| 68 | 68 | $codes = explode('-',$lang); |
| 69 | 69 | if($codes[0] == 'i') |
| 70 | 70 | { |
| 71 | - // Language not listed in ISO 639 that are not variants |
|
| 72 | - // of any listed language, which can be registerd with the |
|
| 73 | - // i-prefix, such as i-cherokee |
|
| 71 | + // Language not listed in ISO 639 that are not variants |
|
| 72 | + // of any listed language, which can be registerd with the |
|
| 73 | + // i-prefix, such as i-cherokee |
|
| 74 | 74 | if(count($codes)>1) |
| 75 | 75 | $lang = $codes[1]; |
| 76 | 76 | } |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | $lang .= '_'.strtoupper($codes[$i]); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | - } |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | if($info->validCulture($lang)) |
| 92 | 92 | $this->languages[] = $lang; |
| 93 | - } |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | 95 | return $this->languages; |
| 96 | 96 | } |
@@ -101,20 +101,20 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | function getCharsets() |
| 103 | 103 | { |
| 104 | - if($this->charsets !== null) { |
|
| 104 | + if($this->charsets !== null) { |
|
| 105 | 105 | return $this->charsets; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $this->charsets = array(); |
| 109 | 109 | |
| 110 | 110 | if (!isset($_SERVER['HTTP_ACCEPT_CHARSET'])) |
| 111 | - return $this->charsets; |
|
| 111 | + return $this->charsets; |
|
| 112 | 112 | |
| 113 | 113 | foreach (explode(',', $_SERVER['HTTP_ACCEPT_CHARSET']) as $charset) |
| 114 | 114 | { |
| 115 | - if (!empty($charset)) |
|
| 116 | - $this->charsets[] = preg_replace('/;.*/', '', $charset); |
|
| 117 | - } |
|
| 115 | + if (!empty($charset)) |
|
| 116 | + $this->charsets[] = preg_replace('/;.*/', '', $charset); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | 119 | return $this->charsets; |
| 120 | 120 | } |