Merge "Remove equal duplicate array key and add FIXME for another one."
[lhc/web/wiklou.git] / includes / Hooks.php
index 6577bbb..bc39f2f 100644 (file)
@@ -86,7 +86,7 @@ class Hooks {
         *
         * @param $event String: event name
         * @param $args Array: parameters passed to hook functions
-        * @return Boolean
+        * @return Boolean True if no handler aborted the hook
         */
        public static function run( $event, $args = array() ) {
                global $wgHooks;
@@ -222,9 +222,7 @@ class Hooks {
 
                        /* String return is an error; false return means stop processing. */
                        if ( is_string( $retval ) ) {
-                               global $wgOut;
-                               $wgOut->showFatalError( $retval );
-                               return false;
+                               throw new FatalError( $retval );
                        } elseif( $retval === null ) {
                                if ( $closure ) {
                                        $prettyFunc = "$event closure";
@@ -250,7 +248,7 @@ class Hooks {
                                                'should return true to continue hook processing or false to abort.'
                                        );
                                }
-                       } else if ( !$retval ) {
+                       } elseif ( !$retval ) {
                                return false;
                        }
                }
@@ -261,7 +259,7 @@ class Hooks {
        /**
         * This REALLY should be protected... but it's public for compatibility
         *
-        * @param $errno Unused
+        * @param $errno int Unused
         * @param $errstr String: error message
         * @return Boolean: false
         */