From 1f24261df3a88f1cd6a3b6f11ce48c3e51789a14 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Wed, 13 Sep 2017 15:47:01 +0200 Subject: [PATCH] Remove language as string for DateFormatter::getInstance Change-Id: I677ab561d67b63f0c86f65fadf9319e41444a22a --- RELEASE-NOTES-1.32 | 2 ++ includes/parser/DateFormatter.php | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) 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; -- 2.20.1