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;
    }