Drop wfRunHooks, deprecated since 1.25
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 10 Oct 2018 22:28:49 +0000 (15:28 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 10 Oct 2018 22:30:00 +0000 (15:30 -0700)
Change-Id: I0350fba3f1a4a4ff500af746609bc9c6b46f0bdf

RELEASE-NOTES-1.32
includes/GlobalFunctions.php
tests/phpunit/includes/HooksTest.php

index fe1c7d4..6a005a0 100644 (file)
@@ -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
index 49a2612..b536e69 100644 (file)
@@ -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.
  *
index c1efc7f..c66b712 100644 (file)
@@ -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