Force type Language for $lang of doEditSectionLink
authorFomafix <fomafix@googlemail.com>
Mon, 23 Jul 2018 19:50:14 +0000 (21:50 +0200)
committerFomafix <fomafix@googlemail.com>
Wed, 17 Oct 2018 04:19:18 +0000 (06:19 +0200)
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

RELEASE-NOTES-1.33
includes/skins/Skin.php

index 7580d30..59443df 100644 (file)
@@ -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.
 === 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 ===
 * …
 
 === Deprecations in 1.33 ===
index f545532..1889167 100644 (file)
@@ -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 "&section=$section"
         * @param string|null $tooltip The tooltip to use for the link: will be escaped
         * @param string $section The designation of the section being pointed to,
         *   to be included in the link, like "&section=$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
         */
         * @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
 
                // 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 )
                $attribs = [];
                if ( !is_null( $tooltip ) ) {
                        $attribs['title'] = $this->msg( 'editsectionhint' )->rawParams( $tooltip )