public function dispatch()
    {
        if ($this->isDispatchable()) {

            $sorted = [];

            foreach($this->attachedToEvents as $eventName)
            {
                $sorted[$eventName] = $this->dispatchedEvents[$eventName];
            }

            call_user_func($this->listener, $sorted);
            if ($this->purge) {
                $this->dispatchedEvents = [];
            }
        }
    }
public function dispatch()
    {
        if ($this->isDispatchable()) {

            $sorted = [];

            foreach($this->attachedToEvents as $eventName)
            {
                $sorted[$eventName] = $this->dispatchedEvents[$eventName];
            }

            call_user_func($this->listener, $sorted);
            if ($this->purge) {
                $this->dispatchedEvents = [];
            }
        }
    }
public function dispatch ( ) { if ( $ this -> isDispatchable ( ) ) { $ sorted = [ ] ; foreach ( $ this -> attachedToEvents as $ eventName ) { $ sorted [ $ eventName ] = $ this -> dispatchedEvents [ $ eventName ] ; } call_user_func ( $ this -> listener , $ sorted ) ; if ( $ this -> purge ) { $ this -> dispatchedEvents = [ ] ; } } }
Try to dispatch the event and clear the event cache

@return void
Try to dispatch the event and clear the event cache