Deprecate rarely or unused *LinkAttributes methods in Linker
authoraude <aude.wiki@gmail.com>
Thu, 13 Nov 2014 16:14:53 +0000 (17:14 +0100)
committeraude <aude.wiki@gmail.com>
Thu, 13 Nov 2014 16:19:38 +0000 (17:19 +0100)
Linker::getInterwikiLinkAttributes and Linker::getInternalLinkAttributesObj
are not not used any code in gerrit.

Linker::getInternalLinkAttributes is used once, in the Video extension.

Change-Id: I76d9b549e0fdccb9c1b4d9c12ba40a67c2733637

RELEASE-NOTES-1.25
includes/Linker.php

index 7ab8772..ea5e8b8 100644 (file)
@@ -185,6 +185,9 @@ changes to languages because of Bugzilla reports.
   <https://www.mediawiki.org/xml/export-0.10.xsd>.
 * MWFunction::call() and MWFunction::callArray() were removed, having being
   deprecated in 1.22.
+* Deprecated the getInternalLinkAttributes, getInternalLinkAttributesObj,
+  and getInternalLinkAttributes methods in Linker, and removed
+  getExternalLinkAttributes method, which was deprecated in MediaWiki 1.18.
 
 == Compatibility ==
 
index 876aa5f..0e9ef2b 100644 (file)
@@ -39,6 +39,8 @@ class Linker {
        /**
         * Get the appropriate HTML attributes to add to the "a" element of an interwiki link.
         *
+        * @deprecated since 1.25
+        *
         * @param string $title The title text for the link, URL-encoded (???) but
         *   not HTML-escaped
         * @param string $unused Unused
@@ -49,6 +51,8 @@ class Linker {
        static function getInterwikiLinkAttributes( $title, $unused = null, $class = 'external' ) {
                global $wgContLang;
 
+               wfDeprecated( __METHOD__, '1.25' );
+
                # @todo FIXME: We have a whole bunch of handling here that doesn't happen in
                # getExternalLinkAttributes, why?
                $title = urldecode( $title );
@@ -61,6 +65,8 @@ class Linker {
        /**
         * Get the appropriate HTML attributes to add to the "a" element of an internal link.
         *
+        * @deprecated since 1.25
+        *
         * @param string $title The title text for the link, URL-encoded (???) but
         *   not HTML-escaped
         * @param string $unused Unused
@@ -68,6 +74,8 @@ class Linker {
         * @return string
         */
        static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) {
+               wfDeprecated( __METHOD__, '1.25' );
+
                $title = urldecode( $title );
                $title = str_replace( '_', ' ', $title );
                return self::getLinkAttributesInternal( $title, $class );
@@ -77,6 +85,8 @@ class Linker {
         * Get the appropriate HTML attributes to add to the "a" element of an internal
         * link, given the Title object for the page we want to link to.
         *
+        * @deprecated since 1.25
+        *
         * @param Title $nt
         * @param string $unused Unused
         * @param string $class The contents of the class attribute, default none
@@ -85,6 +95,8 @@ class Linker {
         * @return string
         */
        static function getInternalLinkAttributesObj( $nt, $unused = null, $class = '', $title = false ) {
+               wfDeprecated( __METHOD__, '1.25' );
+
                if ( $title === false ) {
                        $title = $nt->getPrefixedText();
                }
@@ -94,12 +106,16 @@ class Linker {
        /**
         * Common code for getLinkAttributesX functions
         *
+        * @deprecated since 1.25
+        *
         * @param string $title
         * @param string $class
         *
         * @return string
         */
        private static function getLinkAttributesInternal( $title, $class ) {
+               wfDeprecated( __METHOD__, '1.25' );
+
                $title = htmlspecialchars( $title );
                $class = htmlspecialchars( $class );
                $r = '';