/** * @param $name * @return $this * @throws \InvalidArgumentException */ public function removeAnnotationHandler($name) { if (!isset($this->annotationHandlers[$name])) { throw new \InvalidArgumentException($name . ' is not registered'); } $handler = $this->annotationHandlers[$name]; $this->dispatcher->removeSubscriber($handler); unset($this->annotationHandlers[$name]); return $this; }
/** * Removes an event subscriber from the dispatcher. * * @param EventSubscriberInterface $subscriber The subscriber to remove. * * @return static The current instance. * * @see EventDispatcherInterface::removeSubscriber() */ public function removeEventSubscriber(EventSubscriberInterface $subscriber) { if (!$this->dispatcher) { $this->dispatcher = new EventDispatcher(); } $this->dispatcher->removeSubscriber($subscriber); return $this; }
public function onImportFinish(ImportProcessEvent $event, $eventName, EventDispatcherInterface $eventDispatcher) { if (!$this->isDryRun) { $this->import->getRun()->finish(); } //remove the subscriber when its done $eventDispatcher->removeSubscriber($this); }
/** * Sets a WaitSubscriber using passed in WaitStrategy * * @param WaitStrategy $waitStrategy * @return $this */ public function setWaitStrategy(WaitStrategy $waitStrategy) { if (null !== $this->waitSubscriber) { $this->eventDispatcher->removeSubscriber($this->waitSubscriber); } $this->waitSubscriber = new WaitSubscriber($waitStrategy); $this->addSubscriber($this->waitSubscriber); return $this; }
/** * Disable formatter by name provided. * * @param string $formatter */ public function disableFormatter($formatter) { $this->eventDispatcher->removeSubscriber($this->getFormatter($formatter)); }
/** * Removes an event subscriber. * * @param EventSubscriberInterface $subscriber The subscriber. * * @return void */ public function removeSubscriber(EventSubscriberInterface $subscriber) { $this->dispatcher->removeSubscriber($subscriber); }
/** * Detaches listeners. * * @return void */ protected function detachFromTestCase() { $this->_testCase = null; $this->_eventDispatcher->removeSubscriber($this); }
public function onImportFinish(ImportProcessEvent $event, $eventName, EventDispatcherInterface $eventDispatcher) { //remove the subscriber when its done $eventDispatcher->removeSubscriber($this); }
/** * @inheritdoc */ public function removeSubscriber(EventSubscriberInterface $subscriber) { return $this->eventDispatcher->removeSubscriber($subscriber); }