Adds a set of listeners.

@param string $event
@param callable $listeners
507435
public function addListeners($event, $listeners)
    {
        foreach ($listeners as $listener) {
            $this->addListener($event, $listener);
        }
    }
130771
protected final <T extends EventListener> void addListener(Class<T> listenerType, T listener) {
		if (this.listeners == null) {
			this.listeners = new ListenerCollection<>();
		}
		this.listeners.add(listenerType, listener);
	}
498413
@Override
    public void addListeners(TrainingListener... listeners) {
        if (this.trainingListeners == null) {
            setListeners(listeners);
            return;
        }

        Collections.addAll(trainingListeners, listeners);
    }
1038989
protected function callListeners($event, $args = [])
    {
        if (!$this->hasListeners($event)) {
            return false;
        }

        foreach ($this->listeners[$event] as $listener) {
            $this->callListener($listener, is_array($args) ? $args : [$args]);
        }

        return true;
    }
40665
public function add($type, $listener)
    {
        if (!array_key_exists($type, $this->_eventListeners)) {
            $this->_eventListeners [$type] = [];
        }
        array_push($this->_eventListeners[$type], $listener);
    }
347288
public function setListener($event, callable $listener)
    {
        if (!is_string($event) || empty($event)) {
            throw new \InvalidArgumentException('The event name is invalid');
        }

        $this->listeners[$event] = $listener;
    }
531077
private static function addEventCallbacks(array $events = [])
    {
        $hooks = ['before' => 'ing', 'after' => 'ed'];

        foreach ($events as $event)
        {
            foreach ($hooks as $hook => $suffix)
            {
                $method = $hook . ucfirst($event) . 'e';
                $callback = $event . $suffix;

                self::addObservableEvent($method, $callback);
            }
        }
    }
1124601
public function listen($event, callable $handler)
    {
        if (empty($this->handlers[$event])) {
            $this->handlers[$event] = [];
        }

        $this->handlers[$event][] = $handler;
    }
11419
public function setListeners(array $listeners = [])
    {
        foreach ($listeners as $listener) {
            if (!isset($listener['event']) || !isset($listener['listener'])) {
                throw new InvalidConfigException('Both "event" and "listener" properties are required to attach a listener.');
            }

            if (is_string($listener['listener'])) {
                $listener['listener'] = $this->listenerFromClassName($listener['listener']);
            }

            $this->addListener($listener['event'], $listener['listener'], $listener['priority'] ?? self::P_NORMAL);
        }

        return $this;
    }
1087634
protected function storeListener($event, callable $listener)
    {
        if (!isset($this->listeners[$event])) {
            $this->listeners[$event] = [];
        }
        $this->listeners[$event][] = $listener;

        return $this;
    }
878298
public function addListeners(array $events_config)
    {
        foreach ($events_config as $name => $listeners) {
            if (false === array_key_exists('listeners', $listeners)) {
                $this->application->warning("None listener found for `$name` event.");
                continue;
            }

            $listeners['listeners'] = (array) $listeners['listeners'];
            foreach ($listeners['listeners'] as $listener) {
                $this->addListener($name, $listener);
            }
        }
    }
1106737
public static function removeAllListeners(string $event) : void
    {
        if (Event::hasListeners($event)) {
            unset(Event::$listeners[$event]);
        }
    }
777691
public static function hasListeners(string $event) : bool
    {
        if (! isset(Event::$listeners[$event]) || count(Event::$listeners[$event]) === 0) {
            return false;
        }

        return true;
    }
923050
private function getListenersForEvent($event) {
        $listeners = [];

        foreach ($this->getEventNameParts($event) as $name) {
            if (isset($this->callbacks[$name])) {
                foreach (clone $this->callbacks[$name] as $listener) {
                    $listeners[] = $listener;
                }
            }
        }

        return $listeners;
    }
1206853
private function addListeners(array $events)
    {
        foreach ($events as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && count($listener) === 2 && is_int($listener[1])) {
                    list($listener, $priority) = $listener;
                } else {
                    $priority = 0;
                }
                $this->dispatcher->addListener($eventName, $listener, $priority);
            }
        }

        return $this;
    }
73883
public static function registerListeners(array $listeners)
    {
        foreach ($listeners as $eventName => $eventListeners) {
            foreach ($eventListeners as $listenerClassName) {
                $listener = self::getBean($listenerClassName);
                self::addListener($eventName, $listener);
            }
        }
    }
1059494
public void setListeners(Collection<IWebSocketDataListener> listeners) {
        log.trace("setListeners: {}", listeners);
        this.listeners.addAll(listeners);
    }