Skip to content

Commit

Permalink
if we use SwitchListener, method for handle event must be exists
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Apr 25, 2017
1 parent 62c0aed commit 1fd03a7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Listener/SwitchListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ trait SwitchListenerTrait
*/
public function handle(EventInterface $event)
{
$method = $this->getMethodNameFromEvent($event);

// if method is not exists is not a critical error
if (method_exists($this, $method)) {
call_user_func([$this, $method], $event);
}
call_user_func([$this, $this->getMethodNameFromEvent($event)], $event);
}

/**
Expand Down

0 comments on commit 1fd03a7

Please sign in to comment.