Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / languages / Language.php
index 68727bb..0672315 100644 (file)
@@ -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.
         *
-        *<code>
-        * function timeanddate([...], $format = true) {
-        *      $datePreference = $this->dateFormat($format);
-        * [...]
-        * }
-        *</code>
+        *     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
@@ -3286,14 +3284,14 @@ class Language {
        public function parseFormattedNumber( $number ) {
                $s = $this->digitTransformTable();
                if ( $s ) {
-                       // eliminate empty array values such as ''. (bug 64347)
+                       // eliminate empty array values such as ''. (T66347)
                        $s = array_filter( $s );
                        $number = strtr( $number, array_flip( $s ) );
                }
 
                $s = $this->separatorTransformTable();
                if ( $s ) {
-                       // eliminate empty array values such as ''. (bug 64347)
+                       // eliminate empty array values such as ''. (T66347)
                        $s = array_filter( $s );
                        $number = strtr( $number, array_flip( $s ) );
                }
@@ -3497,7 +3495,7 @@ class Language {
                                $string = $ellipsis . $string;
                        }
                }
-               # Do not truncate if the ellipsis makes the string longer/equal (bug 22181).
+               # Do not truncate if the ellipsis makes the string longer/equal (T24181).
                # This check is *not* redundant if $adjustLength, due to the single case where
                # LEN($ellipsis) > ABS($limit arg); $stringOriginal could be shorter than $string.
                if ( strlen( $string ) < strlen( $stringOriginal ) ) {
@@ -4508,7 +4506,7 @@ class Language {
                # such as action=raw much more expensive than they need to be.
                # This will hopefully cover most cases.
                $talk = preg_replace_callback( '/{{grammar:(.*?)\|(.*?)}}/i',
-                       [ &$this, 'replaceGrammarInNamespace' ], $talk );
+                       [ $this, 'replaceGrammarInNamespace' ], $talk );
                return str_replace( ' ', '_', $talk );
        }