Merge "1.24 -> 1.25"
[lhc/web/wiklou.git] / includes / Hooks.php
index 785e717..668c3d9 100644 (file)
@@ -27,7 +27,8 @@
 /**
  * @since 1.18
  */
-class MWHookException extends MWException {}
+class MWHookException extends MWException {
+}
 
 /**
  * Hooks class.
@@ -37,7 +38,6 @@ class MWHookException extends MWException {}
  * @since 1.18
  */
 class Hooks {
-
        /**
         * Array of events mapped to an array of callbacks to be run
         * when that event is triggered.
@@ -48,7 +48,7 @@ class Hooks {
         * Attach an event handler to a given hook.
         *
         * @param string $name Name of hook
-        * @param mixed $callback Callback function to attach
+        * @param callable $callback Callback function to attach
         *
         * @since 1.18
         */
@@ -64,10 +64,10 @@ class Hooks {
         * Clears hooks registered via Hooks::register(). Does not touch $wgHooks.
         * This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
         *
-        * @param string $name the name of the hook to clear.
+        * @param string $name The name of the hook to clear.
         *
         * @since 1.21
-        * @throws MWException if not in testing mode.
+        * @throws MWException If not in testing mode.
         */
        public static function clear( $name ) {
                if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
@@ -123,7 +123,7 @@ class Hooks {
         * Finally, process the return value and return/throw accordingly.
         *
         * @param string $event Event name
-        * @param array $args  Array of parameters passed to hook functions
+        * @param array $args Array of 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
         *
@@ -179,7 +179,7 @@ class Hooks {
                        // Run autoloader (workaround for call_user_func_array bug)
                        // and throw error if not callable.
                        if ( !is_callable( $callback ) ) {
-                               throw new MWException( 'Invalid callback in hooks for ' . $event . "\n" );
+                               throw new MWException( 'Invalid callback ' . $func . ' in hooks for ' . $event . "\n" );
                        }
 
                        /*