Calls all listeners regardless of their names.

@param array $args
761095
protected function callAllListeners($args = [])
    {
        $args = (array) $args;
        array_map(function ($event) use ($args) {
            $this->callListeners($event, $args);
        }, array_keys($this->listeners));
    }
86605
private function fill(array $args)
    {
        $properties = array_keys(get_object_vars($this));
        foreach ($args as $key => $value) {
            if (in_array($key, $properties)) {
                $this->{$key} = $value;
            }
        }
    }
297529
protected function _callListenersWithCallback($listeners, array $arguments, $continueCallback)
    {
        $counter   = count($listeners);
        $execCount = 0;

        foreach ($listeners as $listener) {
            $counter--;

            if ($result = $this->_callListener($listener, $arguments)) {
                return $result;
            }
            $execCount++;

            if ($counter > 0 && false === $continueCallback()) {
                break;
            }
        }

        return $execCount;
    }
410672
protected function triggerListeners($method, array $params = array())
	{
		if($this->muteListeners === true)
			return;

		// Mute all the listeners cause we don't want listeners called in listeners
		// If we do so: unmute the listeners in the listener method itself
		$this->muteListeners = true;

		foreach($this->listeners as $l) {
			/** @var DBListener $l */
			call_user_func_array(array($l, $method), $params);
		}

		// Unmute listeners cause from now on we're not in a listener method anymore
		$this->muteListeners = false;
	}
77738
public function call($args = [])
    {
        if (count($args) == 0 || empty($args[2]))
            throw new NoticeException('Command "'.$this->key.'": Expecting a name.');

        $this->setName($args[2]);
    }
198093
public function fill($args)
    {
        foreach (get_object_vars($this) as $key => $value) {
            foreach ($args as $argKey => $argValue) {
                if ($key == $argKey || $key == $argKey . "Name") {
                    $this->$key = $argValue;
                }
            }
        }
    }
282891
protected function handle($name, array $args = [])
    {
        if (isset($this->handlers[$name]) && is_callable($this->handlers[$name])) {
            array_unshift($args, $this);
            call_user_func_array($this->handlers[$name], $args);
        }
    }
236916
public function emit($event, $args=null)
    {
        if (is_array($this->listeners)){
            foreach($this->listeners as $reg_exp => $listers_of_event){
                if (preg_match($reg_exp,$event)){
                    foreach ($listers_of_event as $listener){
                        call_user_func($listener,$args,$event);
                    }
                }
            }
        }
    }
499237
public function triggerGroup(?array $events = [], ?array $args = null)
  {
    foreach($events as $callback) {
      if (is_callable($callback)) {
        call_user_func_array($callback, isset($args) ? $args : []);
      }
      else if (is_string($callback)) {
        $call = new $callback;
        call_user_func_array([$call, 'persist'], $args ?? []);
      }
    }
  }
755183
protected function callListener(callable $listener, array $args = [])
    {
        switch (count($args)) {
            case 0:
                return call_user_func($listener);
            case 1:
                return call_user_func($listener, $args[0]);
            case 2:
                return call_user_func($listener, $args[0], $args[1]);
            case 3:
                return call_user_func($listener, $args[0], $args[1], $args[2]);
            case 4:
                return call_user_func($listener, $args[0], $args[1], $args[2], $args[3]);
        }

        return call_user_func_array($listener, $args);
    }
954671
public function setCallbacks(array $callbacks)
    {
        foreach ($callbacks as $attribute => $callback) {
            if (!is_callable($callback)) {
                throw new \InvalidArgumentException(sprintf('The given callback for attribute "%s" is not callable.', $attribute));
            }
        }
        $this->callbacks = $callbacks;
    }
47576
public static function callArgs($callback, array $args = [])
    {
        try {
            $callback = static::evaluateCallback($callback);

            return \call_user_func_array($callback, $args);
        } catch (\Exception $e) {
            $message = $e->getMessage();
        }

        if (\is_array($callback) && \is_object($callback[0])) {
            $callback[0] = \get_class($callback[0]);
        }

        throw new DcGeneralRuntimeException(
            \sprintf(
                'Execute callback %s failed - Exception message: %s',
                (\is_array($callback)
                    ? \implode('::', $callback)
                    : (\is_string($callback)
                        ? $callback
                        : \get_class(
                            $callback
                        ))),
                $message
            ),
            0,
            $e
        );
    }
971091
protected function _callListeners($listeners, array $arguments)
    {
        $execCount = 0;

        foreach ($listeners as $listener) {
            if ($result = $this->_callListener($listener, $arguments)) {
                return $result;
            }
            $execCount++;
        }

        return $execCount;
    }
185438
public function listen($eventName, $callback)
    {
        if (is_array($eventName)) {
            foreach ($eventName as $evnt) {
                $this["dispatcher"]->addListener($evnt, $callback);
            }
        } else {
            $this["dispatcher"]->addListener($eventName, $callback);
        }
    }
515588
public function execute()
    {
        if (!count($this->stack)) {
            foreach ($this->listeners as $cb) {
                $cb($this->pool);
            }
            return;
        }

        $params = $this->getParams();
        $params[] = function ($redis) {
            foreach ($this->listeners as $cb) {
                $cb($redis);
            }
        };
        $this->pool->eval(...$params);
    }
1192914
protected function iterateListeners(array $listeners, $result)
    {
        foreach ($listeners as $listener) {
            call_user_func($listener, $result, $this);
        }
    }
452413
public function handleEvent($event, array $args)
    {
        $logger = $this->getLogger();

        $eventObjects = array_filter($args, function($arg) {
            return $arg instanceof EventInterface;
        });
        if (!$eventObjects) {
            $logger->info('Event emitted without EventInterface argument', array(
                'event' => $event,
                'args' => $args,
            ));
        } else {
            $eventObject = reset($eventObjects);
            if ($this->filter->filter($eventObject) === false) {
                $logger->info('Event did not pass filter, skipping', array(
                    'event' => $event,
                    'args' => $args,
                ));
                return;
            } else {
                $logger->info('Event passed filter, forwarding', array(
                    'event' => $event,
                    'args' => $args,
                ));
            }
        }

        $callbacks = $this->getEventHandlers($event);
        foreach ($callbacks as $callback) {
            $logger->info('Forwarding event to callback', array(
                'event' => $event,
                'args' => $args,
                'callback' => $callback,
            ));
            call_user_func_array($callback, $args);
        }
    }