X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=81564ab202c69844f71b5e55333a9f45eed81eb6;hb=b5370206ff602728c08403f14756d4339bf0a708;hp=92dad9b13459d636fc75c7290a16dc6e889d9da6;hpb=055780106a1d863c936850501fc51894f816ee27;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 92dad9b134..81564ab202 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -167,7 +167,7 @@ class Language { * The form is '/(?:([strong ltr codepoint])|([strong rtl codepoint]))/u' . * * Generated by UnicodeJS (see tools/strongDir) from the UCD; see - * https://git.wikimedia.org/summary/unicodejs.git . + * https://phabricator.wikimedia.org/diffusion/GUJS/ . */ // @codingStandardsIgnoreStart // @codeCoverageIgnoreStart @@ -178,6 +178,7 @@ class Language { /** * Get a cached or new language object for a given language code * @param string $code + * @throws MWException * @return Language */ static function factory( $code ) { @@ -203,7 +204,7 @@ class Language { /** * Create a language object for a given language code * @param string $code - * @param $fallback boolean Whether we're going through language fallback chain + * @param bool $fallback Whether we're going through language fallback chain * @throws MWException * @return Language */ @@ -1584,9 +1585,9 @@ class Language { * @return int[] */ private static function tsToIranian( $ts ) { - $gy = substr( $ts, 0, 4 ) -1600; - $gm = substr( $ts, 4, 2 ) -1; - $gd = substr( $ts, 6, 2 ) -1; + $gy = substr( $ts, 0, 4 ) - 1600; + $gm = substr( $ts, 4, 2 ) - 1; + $gd = substr( $ts, 6, 2 ) - 1; # Days passed from the beginning (including leap years) $gDayNo = 365 * $gy @@ -1666,7 +1667,7 @@ class Language { (int)( ( 275 * $zm ) / 9 ) + $zd + 1729777; } - $zl = $zjd -1948440 + 10632; + $zl = $zjd - 1948440 + 10632; $zn = (int)( ( $zl - 1 ) / 10631 ); $zl = $zl - 10631 * $zn + 354; $zj = ( (int)( ( 10985 - $zl ) / 5316 ) ) * ( (int)( ( 50 * $zl ) / 17719 ) ) + @@ -3346,7 +3347,7 @@ class Language { if ( $start < 0 ) { $start = 0; } - $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber; + $groupedNumber = substr( $number, $start, $end - $start ) . $groupedNumber; $end = $start; if ( $numMatches > 1 ) { // use the last pattern for the rest of the number @@ -4279,7 +4280,7 @@ class Language { * * @since 1.28 * @param Language $lang - * @return boolean + * @return bool */ public function equals( Language $lang ) { return $lang->getCode() === $this->mCode; @@ -4309,7 +4310,7 @@ class Language { */ public function getHtmlCode() { if ( is_null( $this->mHtmlCode ) ) { - $this->mHtmlCode = wfBCP47( $this->getCode() ); + $this->mHtmlCode = LanguageCode::bcp47( $this->getCode() ); } return $this->mHtmlCode; } @@ -4343,7 +4344,7 @@ class Language { /** * @param string $code - * @param boolean $fallback Whether we're going through language fallback chain + * @param bool $fallback Whether we're going through language fallback chain * @return string Name of the language class */ public static function classFromCode( $code, $fallback = true ) {