Merge "parser: Deprecate string type for $lang arg in DateFormatter::getInstance"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 20 Feb 2018 21:16:34 +0000 (21:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 20 Feb 2018 21:16:34 +0000 (21:16 +0000)
RELEASE-NOTES-1.31
includes/parser/DateFormatter.php

index 588d076..2c071b5 100644 (file)
@@ -239,6 +239,8 @@ changes to languages because of Phabricator reports.
   * CommentStore::insertWithTemplate
 * The method ResourceLoaderModule::getPosition(), deprecated in 1.29, has been removed.
 * The DeferredStringifier class is deprecated, use Message::listParam() instead.
+* The type string for the parameter $lang of DateFormatter::getInstance is
+  deprecated.
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported,
index 605a873..0a4a60e 100644 (file)
@@ -126,13 +126,16 @@ class DateFormatter {
        /**
         * Get a DateFormatter object
         *
-        * @param Language|string|null $lang In which language to format the date
+        * @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 );