/** * @param EventSubscriberInterface $subscriber * * @return $this */ public function addEventSubscriber(EventSubscriberInterface $subscriber) { if ($this->eventBus === null) { throw new \RuntimeException('The event bus should not be null'); } $this->eventBus->addSubscriber($subscriber); return $this; }
/** * @param DomainEventSubscriberInterface $subscriber */ protected function addSubscriber(DomainEventSubscriberInterface $subscriber) { $this->eventBus->addSubscriber($subscriber); }