Hard deprecate wfRunHooks()
authorMax Semenik <maxsem.wiki@gmail.com>
Sat, 9 Sep 2017 01:28:05 +0000 (18:28 -0700)
committerLegoktm <legoktm@member.fsf.org>
Tue, 17 Oct 2017 00:36:17 +0000 (00:36 +0000)
Deprecated since 1.25, very few callers. Having to grep for 2
ways of calling a hook is harmful not only because it wastes developers'
time, but also because it makes it possible to forget to search for the
old way, resulting in mistakes. Better get rid of this.

Change-Id: Iab28bd5758475b780c2016847881757d64973862

includes/GlobalFunctions.php
tests/phpunit/includes/HooksTest.php

index ffdfc92..1cff881 100644 (file)
@@ -3232,6 +3232,7 @@ function wfGetParserCacheStorage() {
  * @deprecated since 1.25 - use Hooks::run
  */
 function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) {
  * @deprecated since 1.25 - use Hooks::run
  */
 function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) {
+       wfDeprecated( __METHOD__, '1.25' );
        return Hooks::run( $event, $args, $deprecatedVersion );
 }
 
        return Hooks::run( $event, $args, $deprecatedVersion );
 }
 
index 87acb52..6660516 100644 (file)
@@ -54,6 +54,8 @@ class HooksTest extends MediaWikiTestCase {
         */
        public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) {
                global $wgHooks;
         */
        public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) {
                global $wgHooks;
+
+               $this->hideDeprecated( 'wfRunHooks' );
                $foo = $bar = 'original';
 
                $wgHooks['MediaWikiHooksTest001'][] = $hook;
                $foo = $bar = 'original';
 
                $wgHooks['MediaWikiHooksTest001'][] = $hook;