code: public function hasSubscribers($eventName = null)
      {
          if ($eventName !== null) {
              return !empty($this->subscribers[$eventName]);
          }
          foreach ($this->subscribers as $subscribers) {
              if ($subscribers) {
                  return true;
              }
          }
          return false;
      }
docs: Checks whether an event has any registered subscribers.
  
  @param string $eventName The name of the event
  
  @return boolean