dispatcher = $dispatcher; return $this; } /** * @return EventDispatcherInterface */ public function getDispatcher() { if (null === $this->dispatcher) { throw new \LogicException('Dispatcher was not set'); } return $this->dispatcher; } /** * @see \Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch */ public function dispatch($eventName, Event $event = null) { return $this->getDispatcher()->dispatch($eventName, $event); } }