From: Fomafix Date: Wed, 30 May 2018 04:33:01 +0000 (+0200) Subject: Use type Language instead of string for $lang of doEditSectionLink X-Git-Tag: 1.34.0-rc.0~5021^2~1 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=531e71acdab55df6f567ef43ffaccf4615fe5e66;hp=e599ca39822c27a18053e10cb54aa45b461730f5;p=lhc%2Fweb%2Fwiklou.git Use type Language instead of string for $lang of doEditSectionLink The call of wfGetLangObj( $lang ) is not necessary anymore. Keep $lang as optional parameter to avoid the coding style check error Required argument follows optional Depends-On: Ibe295e7020e995eea52e319feaf59c635f8bb4dc Change-Id: Id49201957e716ef8a2ea930b3616ca4fe6e35633 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 731f874d16..6e823216cf 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -165,6 +165,7 @@ because of Phabricator reports. use 'EditPageGetCheckboxesDefinition' instead. * Linker::getLinkColour() and DummyLinker::getLinkColour(), deprecated since 1.28, were removed. LinkRenderer::getLinkClasses() should be used instead. +* Skin::doEditSectionLink requires type Language for optional parameter $lang. === Deprecations in 1.32 === * Use of a StartProfiler.php file is deprecated in favour of placing diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 265d1516a6..ed1dd192eb 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -314,7 +314,7 @@ class ParserOutput extends CacheTime { return $skin->doEditSectionLink( $editsectionPage, $editsectionSection, $editsectionContent, - $wgLang->getCode() + $wgLang ); }, $text diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 8384ca0c25..60b702232c 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1612,14 +1612,15 @@ abstract class Skin extends ContextSource { * to be included in the link, like "§ion=$section" * @param string $tooltip The tooltip to use for the link: will be escaped * and wrapped in the 'editsectionhint' message - * @param string $lang Language code + * @param Language|null $lang Language object, defaults to user interface language * @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 = null, Language $lang = null ) { // HTML generated here should probably have userlangattributes // added to it for LTR text on RTL pages - $lang = wfGetLangObj( $lang ); + global $wgLang; + $lang = $lang ?: $wgLang; $attribs = []; if ( !is_null( $tooltip ) ) {