Example #1
0
 /**
  * @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;
 }
Example #2
0
 /**
  * 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);
 }
Example #4
0
 /**
  * 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;
 }
Example #5
0
 /**
  * Disable formatter by name provided.
  *
  * @param string $formatter
  */
 public function disableFormatter($formatter)
 {
     $this->eventDispatcher->removeSubscriber($this->getFormatter($formatter));
 }
Example #6
0
 /**
  * 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);
 }
Example #9
0
 /**
  * @inheritdoc
  */
 public function removeSubscriber(EventSubscriberInterface $subscriber)
 {
     return $this->eventDispatcher->removeSubscriber($subscriber);
 }