aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Hooks.php
diff options
context:
space:
mode:
authorReedy <reedy@wikimedia.org>2012-10-05 19:29:26 +0100
committerReedy <reedy@wikimedia.org>2012-10-05 19:29:41 +0100
commit7d34b9c48b9b46fa790e746d9bedb0c83cba9d7f (patch)
tree82252f25aecbac30bed4182fb89b313c51b1d8d2 /includes/Hooks.php
parentfdfe87fbd617e9bcfa7b03a00f62feffb8dc6b2b (diff)
downloadmediawikicore-7d34b9c48b9b46fa790e746d9bedb0c83cba9d7f.tar.gz
mediawikicore-7d34b9c48b9b46fa790e746d9bedb0c83cba9d7f.zip
Add @since tags too Hooks
Update some method documentation Change-Id: If4913aab7d0f8c14d49ca8320e31b1b354145c83
Diffstat (limited to 'includes/Hooks.php')
-rw-r--r--includes/Hooks.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/includes/Hooks.php b/includes/Hooks.php
index bc39f2fc250f..00dccdc084c8 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -23,12 +23,17 @@
* @file
*/
+/**
+ * @since 1.18
+ */
class MWHookException extends MWException {}
/**
* Hooks class.
*
* Used to supersede $wgHooks, because globals are EVIL.
+ *
+ * @since 1.18
*/
class Hooks {
@@ -37,9 +42,10 @@ class Hooks {
/**
* Attach an event handler to a given hook
*
+ * @since 1.18
+ *
* @param $name Mixed: name of hook
* @param $callback Mixed: callback function to attach
- * @return void
*/
public static function register( $name, $callback ) {
if( !isset( self::$handlers[$name] ) ) {
@@ -52,6 +58,8 @@ class Hooks {
/**
* Returns true if a hook has a function registered to it.
*
+ * @since 1.18
+ *
* @param $name Mixed: name of hook
* @return Boolean: true if a hook has a function registered to it
*/
@@ -66,6 +74,8 @@ class Hooks {
/**
* Returns an array of all the event functions attached to a hook
*
+ * @since 1.18
+ *
* @param $name Mixed: name of the hook
* @return array
*/
@@ -84,8 +94,12 @@ class Hooks {
* careful about its contents. So, there's a lot more error-checking
* in here than would normally be necessary.
*
+ * @since 1.18
+ *
* @param $event String: event name
* @param $args Array: parameters passed to hook functions
+ * @throws MWException
+ * @throws FatalError
* @return Boolean True if no handler aborted the hook
*/
public static function run( $event, $args = array() ) {
@@ -259,8 +273,11 @@ class Hooks {
/**
* This REALLY should be protected... but it's public for compatibility
*
+ * @since 1.18
+ *
* @param $errno int Unused
* @param $errstr String: error message
+ * @throws MWHookException
* @return Boolean: false
*/
public static function hookErrorHandler( $errno, $errstr ) {