clean code
This commit is contained in:
@@ -24,19 +24,15 @@ class EventDispatcher
|
||||
|
||||
public static function __callStatic($name, $arguments)
|
||||
{
|
||||
if(count($arguments)==2)
|
||||
{
|
||||
if (count($arguments) == 2) {
|
||||
$instance = self::getInstance();
|
||||
$event = $arguments[0];
|
||||
if($name=="on")
|
||||
{
|
||||
if(is_callable($arguments[1]))
|
||||
{
|
||||
if ($name == "on") {
|
||||
if (is_callable($arguments[1])) {
|
||||
$instance->emitter->on($event, $arguments[1]);
|
||||
}
|
||||
}
|
||||
if($name=="emit")
|
||||
{
|
||||
if ($name == "emit") {
|
||||
$instance->emitter->emit($event, $arguments);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user