From: James D. Forrester Date: Wed, 10 Oct 2018 22:28:49 +0000 (-0700) Subject: Drop wfRunHooks, deprecated since 1.25 X-Git-Tag: 1.34.0-rc.0~3809^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=17e5334fc9bcaaf06a0d3dd591aaaafe3dfefd81;hp=e888061ca91fbc414fa29c75d224276e16bedd45;p=lhc%2Fweb%2Fwiklou.git Drop wfRunHooks, deprecated since 1.25 Change-Id: I0350fba3f1a4a4ff500af746609bc9c6b46f0bdf --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index fe1c7d4d11..6a005a065b 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -343,6 +343,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