Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function hasHandlers(string $eventType = null) : bool
 {
     if ($eventType === null) {
         return (bool) count($this->serviceIds) || (bool) count($this->handlers);
     }
     if (isset($this->serviceIds[$eventType])) {
         return true;
     }
     return parent::hasHandlers($eventType);
 }
Ejemplo n.º 2
0
 public function test_that_remove_handler_does_not_error_when_handler_not_registered()
 {
     $this->dispatcher->removeHandler('foo', function () {
     });
     $this->assertFalse($this->dispatcher->hasHandlers());
 }