public function dispatch(EventInterface $event)
    {
        if (array_key_exists($event->getName(), $this->listeners)) {
            foreach ($this->listeners[$event->getName()] as $listener) {
                $listener($event);
            }
        }

        return $event;
    }
public function dispatch(EventInterface $event)
    {
        if (array_key_exists($event->getName(), $this->listeners)) {
            foreach ($this->listeners[$event->getName()] as $listener) {
                $listener($event);
            }
        }

        return $event;
    }
public function dispatch ( EventInterface $ event ) { if ( array_key_exists ( $ event -> getName ( ) , $ this -> listeners ) ) { foreach ( $ this -> listeners [ $ event -> getName ( ) ] as $ listener ) { $ listener ( $ event ) ; } } return $ event ; }
Dispatch an event. Can be any event object which implements `PhpSchool\PhpWorkshop\Event\EventInterface`.

@param EventInterface $event
@return EventInterface
Dispatch an event . Can be any event object which implements PhpSchool \ PhpWorkshop \ Event \ EventInterface .