From: jenkins-bot Date: Thu, 11 Oct 2018 19:41:18 +0000 (+0000) Subject: Merge "Drop wfRunHooks, deprecated since 1.25" X-Git-Tag: 1.34.0-rc.0~3809 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=36e1c72d0af6d26ff2d86eabd0cfa0f17b9658f8;hp=0ecfa4b91961269e33c085bc5d88eb8850439d40;p=lhc%2Fweb%2Fwiklou.git Merge "Drop wfRunHooks, deprecated since 1.25" --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index d4fd4142cb..70eb920207 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -347,6 +347,8 @@ because of Phabricator reports. * The hook 'DoEditSectionLink', deprecated since 1.25, has been removed. Use the hook 'SkinEditSectionLinks' instead. * The hook 'UserGetImplicitGroups', deprecated since 1.25, has been removed. +* The global function wfRunHooks, deprecated since 1.25, has now been removed. + Use Hooks::run(). === Deprecations in 1.32 === * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 49a2612360..b536e694db 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3037,21 +3037,6 @@ function wfGetMessageCacheStorage() { return ObjectCache::getInstance( $wgMessageCacheType ); } -/** - * Call hook functions defined in $wgHooks - * - * @param string $event Event name - * @param array $args Parameters passed to hook functions - * @param string|null $deprecatedVersion Optionally mark hook as deprecated with version number - * - * @return bool True if no handler aborted the hook - * @deprecated since 1.25 - use Hooks::run - */ -function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) { - wfDeprecated( __METHOD__, '1.25' ); - return Hooks::run( $event, $args, $deprecatedVersion ); -} - /** * Wrapper around php's unpack. * diff --git a/tests/phpunit/includes/HooksTest.php b/tests/phpunit/includes/HooksTest.php index c1efc7ffec..c66b712b83 100644 --- a/tests/phpunit/includes/HooksTest.php +++ b/tests/phpunit/includes/HooksTest.php @@ -54,23 +54,6 @@ class HooksTest extends MediaWikiTestCase { ]; } - /** - * @dataProvider provideHooks - * @covers ::wfRunHooks - */ - public function testOldStyleHooks( $msg, array $hook, $expectedFoo, $expectedBar ) { - global $wgHooks; - - $this->hideDeprecated( 'wfRunHooks' ); - $foo = $bar = 'original'; - - $wgHooks['MediaWikiHooksTest001'][] = $hook; - wfRunHooks( 'MediaWikiHooksTest001', [ &$foo, &$bar ] ); - - $this->assertSame( $expectedFoo, $foo, $msg ); - $this->assertSame( $expectedBar, $bar, $msg ); - } - /** * @dataProvider provideHooks * @covers Hooks::register