public function listen($event, \Closure $callback): void
    {
        // check if $event is a single string and set it as array with one item
        if (!Any::isArray($event)) {
            $event = [$event];
        }
        
        // each every one event in array
        foreach ($event as $item) {
            if (Any::isArray($this->runned) && array_key_exists($item, $this->runned)) {
                call_user_func_array($callback, $this->runned[$item]);
            }
        }
    }
public function listen($event, \Closure $callback): void
    {
        // check if $event is a single string and set it as array with one item
        if (!Any::isArray($event)) {
            $event = [$event];
        }
        
        // each every one event in array
        foreach ($event as $item) {
            if (Any::isArray($this->runned) && array_key_exists($item, $this->runned)) {
                call_user_func_array($callback, $this->runned[$item]);
            }
        }
    }
public function listen ( $ event , \ Closure $ callback ) : void { // check if $event is a single string and set it as array with one item if ( ! Any :: isArray ( $ event ) ) { $ event = [ $ event ] ; } // each every one event in array foreach ( $ event as $ item ) { if ( Any :: isArray ( $ this -> runned ) && array_key_exists ( $ item , $ this -> runned ) ) { call_user_func_array ( $ callback , $ this -> runned [ $ item ] ) ; } } }
Catch the event if it occurred before the initiation of interception
@param string|array $event
@param \Closure $callback
@return void
Catch the event if it occurred before the initiation of interception