X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=languages%2FLanguage.php;h=14e6f5c63bb3d6177d347986754a5987aac46f48;hb=5f1ab1312e01b5078e9c7384ed54c473b7591390;hp=6a83044730a1353e16c069ec5cce1cca677af780;hpb=766d795f27df5f956e9d48bba63c4bfe3848ba86;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 6a83044730..14e6f5c63b 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -415,10 +415,10 @@ class Language { function __construct() { $this->mConverter = new FakeConverter( $this ); // Set the code to the name of the descendant - if ( get_class( $this ) == 'Language' ) { + if ( static::class === 'Language' ) { $this->mCode = 'en'; } else { - $this->mCode = str_replace( '_', '-', strtolower( substr( get_class( $this ), 8 ) ) ); + $this->mCode = str_replace( '_', '-', strtolower( substr( static::class, 8 ) ) ); } self::getLocalisationCache(); } @@ -2158,12 +2158,10 @@ class Language { * the date preference they're supposed to use, it should be used in * all children. * - * - * function timeanddate([...], $format = true) { - * $datePreference = $this->dateFormat($format); - * [...] - * } - * + * function timeanddate([...], $format = true) { + * $datePreference = $this->dateFormat($format); + * [...] + * } * * @param int|string|bool $usePrefs If true, the user's preference is used * if false, the site/language default is used @@ -4129,7 +4127,7 @@ class Language { * Get the list of variants supported by this language * see sample implementation in LanguageZh.php * - * @return array An array of language codes + * @return string[] An array of language codes */ public function getVariants() { return $this->mConverter->getVariants();