From: Fomafix Date: Mon, 23 Jul 2018 19:50:14 +0000 (+0200) Subject: Force type Language for $lang of doEditSectionLink X-Git-Tag: 1.34.0-rc.0~3746^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=62b7f12418566ec24ed6b10ed749aca060e84b85 Force type Language for $lang of doEditSectionLink Also make the parameter $tooltip mandatory to ensure that a mandatory parameter does follow an optional parameter. ParserOutput always fill all parameters of doEditSectionLink. The call of wfGetLangObj( $lang ) is not necessary anymore. This change is a follow-up to Id49201957e716ef8a2ea930b3616ca4fe6e35633. Change-Id: Ic49d76c7d9357f99b462471696f7e1eb86e70e3d --- diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index 7580d300da..59443dfda4 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -49,6 +49,9 @@ because of Phabricator reports. === Breaking changes in 1.33 === * The parameteter $lang in DifferenceEngine::setTextLanguage must be of type Language. Other types are deprecated since 1.32. +* Skin::doEditSectionLink requires type Language for the parameter $lang. + The parameters $tooltip and $lang are mandatory. Omitting the parameters is + deprecated since 1.32. * … === Deprecations in 1.33 === diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index f545532382..18891672ec 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1610,21 +1610,14 @@ abstract class Skin extends ContextSource { * @param string $section The designation of the section being pointed to, * to be included in the link, like "§ion=$section" * @param string|null $tooltip The tooltip to use for the link: will be escaped - * and wrapped in the 'editsectionhint' message. - * Not setting this parameter is deprecated. - * @param Language|string $lang Language object or language code string. - * Type string is deprecated. Not setting this parameter is deprecated. + * and wrapped in the 'editsectionhint' message + * @param Language $lang Language object * @return string HTML to use for edit link */ - public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) { + public function doEditSectionLink( Title $nt, $section, $tooltip, Language $lang ) { // HTML generated here should probably have userlangattributes // added to it for LTR text on RTL pages - if ( !$lang instanceof Language ) { - wfDeprecated( __METHOD__ . ' with other type than Language for $lang', '1.32' ); - $lang = wfGetLangObj( $lang ); - } - $attribs = []; if ( !is_null( $tooltip ) ) { $attribs['title'] = $this->msg( 'editsectionhint' )->rawParams( $tooltip )