當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::isPropagationStopped方法代碼示例

本文整理匯總了PHP中Symfony\Component\EventDispatcher\Event::isPropagationStopped方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::isPropagationStopped方法的具體用法?PHP Event::isPropagationStopped怎麽用?PHP Event::isPropagationStopped使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\EventDispatcher\Event的用法示例。


在下文中一共展示了Event::isPropagationStopped方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doDispatch

 /**
  * {@inheritdoc}
  */
 protected function doDispatch($listeners, $eventName, Event $event)
 {
     foreach ($listeners as $listener) {
         if ($event->isPropagationStopped()) {
             break;
         }
         $this->currentListenerSniffCodeProvider->setCurrentListener($listener);
         call_user_func($listener, $event, $eventName, $this);
     }
 }
開發者ID:symplify,項目名稱:php7_codesniffer,代碼行數:13,代碼來源:SniffDispatcher.php

示例2: brocast

 protected function brocast(Event $event)
 {
     $eventName = $event->getName();
     $listeners = [];
     foreach ($this->events[$eventName] as &$eventGroup) {
         foreach ($eventGroup as $listenerArray) {
             list($listener, $priority) = $listenerArray;
             $listeners[$priority][] = $listener;
         }
     }
     krsort($listeners);
     $processCount = 0;
     foreach ($listeners as $listener) {
         foreach ($listener as $callback) {
             if ($event && $event->isPropagationStopped()) {
                 return $processCount;
             }
             $callback($event);
             $processCount++;
         }
     }
     return $processCount;
 }
開發者ID:adon988,項目名稱:phpsocket.io,代碼行數:23,代碼來源:EventDispatcher.php

示例3: testStopPropagationAndIsPropagationStopped

 public function testStopPropagationAndIsPropagationStopped()
 {
     $this->event->stopPropagation();
     $this->assertTrue($this->event->isPropagationStopped());
 }
開發者ID:usefulthink,項目名稱:symfony,代碼行數:5,代碼來源:EventTest.php

示例4: dispatch

 /**
  * {@inheritdoc}
  */
 public function dispatch($eventName, Event $event = null)
 {
     if (null === $event) {
         $event = new Event();
     }
     if (null !== $this->logger && $event->isPropagationStopped()) {
         $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
     }
     $this->preProcess($eventName);
     $this->preDispatch($eventName, $event);
     $e = $this->stopwatch->start($eventName, 'section');
     $this->dispatcher->dispatch($eventName, $event);
     if ($e->isStarted()) {
         $e->stop();
     }
     $this->postDispatch($eventName, $event);
     $this->postProcess($eventName);
     return $event;
 }
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:22,代碼來源:TraceableEventDispatcher.php

示例5: isStopped

 /**
  * Determine if the event has been stopped from propagating.
  *
  * @return bool
  */
 public function isStopped()
 {
     return parent::isPropagationStopped();
 }
開發者ID:defra91,項目名稱:levecchiecredenze.it,代碼行數:9,代碼來源:Event.php


注:本文中的Symfony\Component\EventDispatcher\Event::isPropagationStopped方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。