code: protected function pushEvent(Event $event)
      {
          $eventName = $event->getName();
          if (in_array($eventName, $this->eventStack)) {
              throw new \RuntimeException(sprintf("Circular call to script handler '%s' detected", $eventName));
          }
  
          return array_push($this->eventStack, $eventName);
      }
docs: Push an event to the stack of active event
  
  @param  Event             $event
  @throws \RuntimeException
  @return number