linker: Hard-deprecate LinkBegin and LinkEnd hooks
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 10 Jun 2018 18:30:15 +0000 (11:30 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 10 Jun 2018 19:00:15 +0000 (12:00 -0700)
Change-Id: Ia1d766d019a2711c96e7c41913055774eff9f777

includes/linker/LinkRenderer.php
tests/phpunit/includes/LinkerTest.php

index 87d7e0a..d096b00 100644 (file)
@@ -204,7 +204,7 @@ class LinkRenderer {
                        $realHtml = $html = null;
                }
                if ( !Hooks::run( 'LinkBegin',
-                       [ $dummy, $title, &$html, &$extraAttribs, &$query, &$options, &$ret ] )
+                       [ $dummy, $title, &$html, &$extraAttribs, &$query, &$options, &$ret ], '1.28' )
                ) {
                        return $ret;
                }
@@ -373,7 +373,7 @@ class LinkRenderer {
                        $title = Title::newFromLinkTarget( $target );
                        $options = $this->getLegacyOptions( $isKnown );
                        if ( !Hooks::run( 'LinkEnd',
-                               [ $dummy, $title, $options, &$html, &$attribs, &$ret ] )
+                               [ $dummy, $title, $options, &$html, &$attribs, &$ret ], '1.28' )
                        ) {
                                return $ret;
                        }
index f9e2cc1..f90ece9 100644 (file)
@@ -370,6 +370,7 @@ class LinkerTest extends MediaWikiLangTestCase {
         * @dataProvider provideLinkBeginHook
         */
        public function testLinkBeginHook( $callback, $expected ) {
+               $this->hideDeprecated( 'LinkBegin hook (used in hook-LinkBegin-closure)' );
                $this->setMwGlobals( [
                        'wgArticlePath' => '/wiki/$1',
                        'wgServer' => '//example.org',
@@ -417,6 +418,7 @@ class LinkerTest extends MediaWikiLangTestCase {
         * @dataProvider provideLinkEndHook
         */
        public function testLinkEndHook( $callback, $expected ) {
+               $this->hideDeprecated( 'LinkEnd hook (used in hook-LinkEnd-closure)' );
                $this->setMwGlobals( [
                        'wgArticlePath' => '/wiki/$1',
                ] );