本文整理汇总了PHP中Symfony\Component\EventDispatcher\EventDispatcherInterface::removeSubscriber方法的典型用法代码示例。如果您正苦于以下问题:PHP EventDispatcherInterface::removeSubscriber方法的具体用法?PHP EventDispatcherInterface::removeSubscriber怎么用?PHP EventDispatcherInterface::removeSubscriber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\EventDispatcher\EventDispatcherInterface
的用法示例。
在下文中一共展示了EventDispatcherInterface::removeSubscriber方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeAnnotationHandler
/**
* @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;
}
示例2: removeEventSubscriber
/**
* 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;
}
示例3: onImportFinish
public function onImportFinish(ImportProcessEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
{
if (!$this->isDryRun) {
$this->import->getRun()->finish();
}
//remove the subscriber when its done
$eventDispatcher->removeSubscriber($this);
}
示例4: setWaitStrategy
/**
* 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;
}
示例5: disableFormatter
/**
* Disable formatter by name provided.
*
* @param string $formatter
*/
public function disableFormatter($formatter)
{
$this->eventDispatcher->removeSubscriber($this->getFormatter($formatter));
}
示例6: removeSubscriber
/**
* Removes an event subscriber.
*
* @param EventSubscriberInterface $subscriber The subscriber.
*
* @return void
*/
public function removeSubscriber(EventSubscriberInterface $subscriber)
{
$this->dispatcher->removeSubscriber($subscriber);
}
示例7: detachFromTestCase
/**
* Detaches listeners.
*
* @return void
*/
protected function detachFromTestCase()
{
$this->_testCase = null;
$this->_eventDispatcher->removeSubscriber($this);
}
示例8: onImportFinish
public function onImportFinish(ImportProcessEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
{
//remove the subscriber when its done
$eventDispatcher->removeSubscriber($this);
}
示例9: removeSubscriber
/**
* @inheritdoc
*/
public function removeSubscriber(EventSubscriberInterface $subscriber)
{
return $this->eventDispatcher->removeSubscriber($subscriber);
}