Beispiel #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);
         }
     }
 }
Beispiel #2
0
 public function testGetListenersNoSuchEventException()
 {
     $this->setExpectedException(NoSuchEventException::class);
     $this->collection->getListeners('null');
 }