Skip to content

Commit

Permalink
Merge pull request #55 from WyriHaximus-labs/less-complicated-off
Browse files Browse the repository at this point in the history
Less complicated off
  • Loading branch information
WyriHaximus committed May 15, 2018
2 parents b9f8166 + 6c8987e commit e5c7014
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Evenement/EventEmitterTrait.php
Expand Up @@ -50,11 +50,11 @@ public function once($event, callable $listener)

public function off($event, callable $listener = null)
{
if ($listener) {
return $this->removeListener($event, $listener);
} else {
return $this->removeAllListeners($event);
if ($listener === null) {
return $this->removeListener($event, $listener);
}

return $this->removeAllListeners($event);
}

public function removeListener($event, callable $listener)
Expand Down

0 comments on commit e5c7014

Please sign in to comment.