Skip to content

Commit

Permalink
minor code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Apr 22, 2019
1 parent 42f12f7 commit 7c9b63b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inc/Extension/EventHandler.php
Expand Up @@ -75,7 +75,7 @@ public function process_event($event, $advise = '')
foreach ($sequenced_hooks as $hook) {
list($obj, $method, $param) = $hook;

if (is_null($obj)) {
if ($obj === null) {
$method($event, $param);
} else {
$obj->$method($event, $param);
Expand All @@ -101,8 +101,8 @@ public function hasHandlerForEvent($name, $advise = '')
{
if ($advise) {
return isset($this->hooks[$name . '_' . $advise]);
} else {
return isset($this->hooks[$name . '_BEFORE']) || isset($this->hooks[$name . '_AFTER']);
}

return isset($this->hooks[$name . '_BEFORE']) || isset($this->hooks[$name . '_AFTER']);
}
}

0 comments on commit 7c9b63b

Please sign in to comment.