From: Fomafix Date: Wed, 13 Sep 2017 13:47:01 +0000 (+0200) Subject: Remove language as string for DateFormatter::getInstance X-Git-Tag: 1.34.0-rc.0~5675^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta//%22%22?a=commitdiff_plain;h=1f24261df3a88f1cd6a3b6f11ce48c3e51789a14;p=lhc%2Fweb%2Fwiklou.git Remove language as string for DateFormatter::getInstance Change-Id: I677ab561d67b63f0c86f65fadf9319e41444a22a --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 7971bccdf1..c9ebbfbf57 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -50,6 +50,8 @@ changes to languages because of Phabricator reports. Use Skin::msg() instead. * wfInitShellLocale() was removed (deprecated in 1.30). * wfShellExecDisabled() was removed (deprecated in 1.30). +* The type string for the parameter $lang of DateFormatter::getInstance is + removed (deprecated in 1.31). === Deprecations in 1.32 === * Use of a StartProfiler.php file is deprecated in favour of placing diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 0a4a60e9e5..2aefc0396f 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -130,13 +130,10 @@ class DateFormatter { * Defaults to the site content language * @return DateFormatter */ - public static function getInstance( $lang = null ) { + public static function getInstance( Language $lang = null ) { global $wgContLang, $wgMainCacheType; - if ( is_string( $lang ) ) { - wfDeprecated( __METHOD__ . ' with type string for $lang', '1.31' ); - } - $lang = $lang ? wfGetLangObj( $lang ) : $wgContLang; + $lang = $lang ?: $wgContLang; $cache = ObjectCache::getLocalServerInstance( $wgMainCacheType ); static $dateFormatter = false;