Ejemplo n.º 1
0
 public function dispatch(EventInterface $event)
 {
     if ($this->eventMap->hasListeners($event->getName())) {
         $listeners = $this->eventMap->getListeners($event->getName());
         $res = null;
         while (count($listeners) > 0 && $res !== false) {
             $listener = array_shift($listeners);
             $res = $listener->handle($event);
             $this->eventMap->setDispatched($event->getName(), $listener);
         }
     }
 }
Ejemplo n.º 2
0
 public function testSetDispatchedException()
 {
     $this->setExpectedException(NoSuchListenerException::class);
     $this->collection->addListener('null', $this->createListeners());
     $this->collection->setDispatched('null', $this->createListeners());
 }