Merge "tests: Remove some unused stuff in phpunit tests"
[lhc/web/wiklou.git] / includes / parser / DateFormatter.php
index 08e3c77..0a4a60e 100644 (file)
@@ -107,7 +107,7 @@ class DateFormatter {
                $this->targets[self::ISO2] = '[[y-m-d]]';
 
                # Rules
-               #            pref    source       target
+               #            pref       source      target
                $this->rules[self::DMY][self::MD] = self::DM;
                $this->rules[self::ALL][self::MD] = self::MD;
                $this->rules[self::MDY][self::DM] = self::MD;
@@ -126,13 +126,16 @@ class DateFormatter {
        /**
         * Get a DateFormatter object
         *
-        * @param Language|string|null $lang In which language to format the date
-        *              Defaults to the site content language
+        * @param Language|null $lang In which language to format the date
+        *     Defaults to the site content language
         * @return DateFormatter
         */
        public static function getInstance( $lang = null ) {
                global $wgContLang, $wgMainCacheType;
 
+               if ( is_string( $lang ) ) {
+                       wfDeprecated( __METHOD__ . ' with type string for $lang', '1.31' );
+               }
                $lang = $lang ? wfGetLangObj( $lang ) : $wgContLang;
                $cache = ObjectCache::getLocalServerInstance( $wgMainCacheType );
 
@@ -197,7 +200,7 @@ class DateFormatter {
 
                        // Another horrible hack
                        $this->mLinked = $linked;
-                       $text = preg_replace_callback( $regex, [ &$this, 'replace' ], $text );
+                       $text = preg_replace_callback( $regex, [ $this, 'replace' ], $text );
                        unset( $this->mLinked );
                }
                return $text;