From: Max Semenik Date: Sat, 9 Sep 2017 01:28:05 +0000 (-0700) Subject: Hard deprecate wfRunHooks() X-Git-Tag: 1.31.0-rc.0~1759 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=ca887b530144b95ce2b6dfe2354cc5a11d29f352 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 --- 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;