src/Event/EventDispatcher.php
public function dispatch(string $eventCode, EventInterface $event)
    {
        $this->assertValidEventCode($eventCode);
        if (true === isset($this->eventListeners[$eventCode])) {
            foreach ($this->eventListeners[$eventCode] as $listener) {
                $listener($event);
            }
        }

        return $this;
    }
public function dispatch(string $eventCode, EventInterface $event)
    {
        $this->assertValidEventCode($eventCode);
        if (true === isset($this->eventListeners[$eventCode])) {
            foreach ($this->eventListeners[$eventCode] as $listener) {
                $listener($event);
            }
        }

        return $this;
    }
public function dispatch ( string $ eventCode , EventInterface $ event ) { $ this -> assertValidEventCode ( $ eventCode ) ; if ( true === isset ( $ this -> eventListeners [ $ eventCode ] ) ) { foreach ( $ this -> eventListeners [ $ eventCode ] as $ listener ) { $ listener ( $ event ) ; } } return $ this ; }
Invoke all event listeners for the given event code

@param string         $eventCode
@param EventInterface $event
@return $this
Invoke all event listeners for the given event code