From ca887b530144b95ce2b6dfe2354cc5a11d29f352 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Fri, 8 Sep 2017 18:28:05 -0700 Subject: [PATCH] Hard deprecate wfRunHooks() 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 | 1 + tests/phpunit/includes/HooksTest.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ffdfc92c4d..1cff881c21 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3232,6 +3232,7 @@ function wfGetParserCacheStorage() { * @deprecated since 1.25 - use Hooks::run */ function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) { + wfDeprecated( __METHOD__, '1.25' ); return Hooks::run( $event, $args, $deprecatedVersion ); } diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php index 87acb52e1a..666051666b 100644 --- a/tests/phpunit/includes/HooksTest.php +++ b/tests/phpunit/includes/HooksTest.php @@ -54,6 +54,8 @@ class HooksTest extends MediaWikiTestCase { */ public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) { global $wgHooks; + + $this->hideDeprecated( 'wfRunHooks' ); $foo = $bar = 'original'; $wgHooks['MediaWikiHooksTest001'][] = $hook; -- 2.20.1