diff options
Diffstat (limited to 'inc/events.php')
-rw-r--r-- | inc/events.php | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/inc/events.php b/inc/events.php index 318a7617e..35d55d0e3 100644 --- a/inc/events.php +++ b/inc/events.php @@ -27,8 +27,11 @@ class Doku_Event { /** * event constructor + * + * @param string $name + * @param mixed $data */ - function Doku_Event($name, &$data) { + function __construct($name, &$data) { $this->name = $name; $this->data =& $data; @@ -120,14 +123,18 @@ class Doku_Event { * stop any further processing of the event by event handlers * this function does not prevent the default action taking place */ - function stopPropagation() { $this->_continue = false; } + function stopPropagation() { + $this->_continue = false; + } /** * preventDefault * * prevent the default action taking place */ - function preventDefault() { $this->_default = false; } + function preventDefault() { + $this->_default = false; + } } /** @@ -146,7 +153,7 @@ class Doku_Event_Handler { * constructor, loads all action plugins and calls their register() method giving them * an opportunity to register any hooks they require */ - function Doku_Event_Handler() { + function __construct() { // load action plugins /** @var DokuWiki_Action_Plugin $plugin */ @@ -165,13 +172,13 @@ class Doku_Event_Handler { * * register a hook for an event * - * @param $event string name used by the event, (incl '_before' or '_after' for triggers) - * @param $advise string - * @param $obj object object in whose scope method is to be executed, + * @param string $event string name used by the event, (incl '_before' or '_after' for triggers) + * @param string $advise + * @param object $obj object in whose scope method is to be executed, * if NULL, method is assumed to be a globally available function - * @param $method string event handler function - * @param $param mixed data passed to the event handler - * @param $seq int sequence number for ordering hook execution (ascending) + * @param string $method event handler function + * @param mixed $param data passed to the event handler + * @param int $seq sequence number for ordering hook execution (ascending) */ function register_hook($event, $advise, $obj, $method, $param=null, $seq=0) { $seq = (int)$seq; @@ -216,14 +223,14 @@ class Doku_Event_Handler { * * function wrapper to process (create, trigger and destroy) an event * - * @param $name string name for the event - * @param $data mixed event data - * @param $action callback (optional, default=NULL) default action, a php callback function - * @param $canPreventDefault bool (optional, default=true) can hooks prevent the default action + * @param string $name name for the event + * @param mixed $data event data + * @param callback $action (optional, default=NULL) default action, a php callback function + * @param bool $canPreventDefault (optional, default=true) can hooks prevent the default action * * @return mixed the event results value after all event processing is complete - * by default this is the return value of the default action however - * it can be set or modified by event handler hooks + * by default this is the return value of the default action however + * it can be set or modified by event handler hooks */ function trigger_event($name, &$data, $action=null, $canPreventDefault=true) { |