Returns the requested event if exists

@param  string                                   $eventName
@return \Symfony\Component\EventDispatcher\Event
172379
protected function fetchEvent($eventName)
    {
        return (array_key_exists($eventName, $this->events)) ? $this->events[$eventName] : null;
    }
950793
public function trigger(string $eventName, EventInterface $event = \null): EventInterface
    {
        $this->checkEventName($eventName);
        if (\null === $event) {
            $event = new Event();
        }
        $priorities = $this->getListeners($eventName);
        if (0 !== \count($priorities)) {
            /**
             * @var array    $listeners
             * @var callable $listener
             */
            foreach ($priorities as $listeners) {
                foreach ($listeners as $listener) {
                    $listener($event, $eventName, $this);
                    /** @noinspection DisconnectedForeachInstructionInspection */
                    if ($event->hasBeenHandled()) {
                        break 2;
                    }
                }
            }
        }
        return $event;
    }
621061
private function getEventSubscribers(string $eventName): array
    {
        if ($this->isEventAllowed($eventName) === false) {
            throw new EventNotFoundException($eventName);
        }

        $result = $this->getSubscribers()[$eventName] ?? [];

        return $result;
    }
1041387
protected function triggerEvent($eventName, NodeInterface $node = null)
    {
        if (isset($this->activeEvents[$eventName])) {
            $this->dispatcher->dispatch($eventName, $this->sharedEvent->setNode($node));
        }

        return $this;
    }
1181393
public function getListeners($eventName = null) {

        if ($eventName) {

            if (empty($this->registry[$eventName])) {
                return [];
            }

            return $this->getSortedRegistry($eventName);

        }

        foreach ($this->registry as $eventName => $listeners) {
            $this->getSortedRegistry($eventName);
        }

        return $this->sortedRegistry;

    }
601888
protected function make($eventName)
    {
        $scenarioClassName = $this->registeredScenarios[$eventName];

        if (is_callable($scenarioClassName)) {
            return $this->resolveClosure($scenarioClassName);
        }

        return new $scenarioClassName;
    }
250583
public function getEventLog(Event $event, $eventName)
    {
        $eventLog = $this->getEventLogObject($this->getEventLogInfo($event, $eventName));

        if (null === $eventLog) {
            return null;
        }

        $eventLog->setTypeId($eventName);
        $eventLog->setIp($this->getClientIp());
        $eventLog->setEventTime(new \DateTime());
        $this->setUser($eventLog);

        return $eventLog;
    }
1082186
public function flush($eventName)
    {
        $result = $this->dispatch($eventName . self::QUEUE_NAME);
        // If result is an array then need to merge or will end up with array of arrays.
        if (is_array($result)) {
            $result = call_user_func_array('array_merge', $result);
        }

        return $result;
    }
891507
public function cleanEventName($eventName)
    {
        $eventName = strtolower($eventName);
        $eventName = str_replace('..', '.', $eventName);
        $eventName = trim($eventName, '.');
        $eventName = trim($eventName);

        if (!$eventName) {
            throw new Exception('Event name is empty!');
        }

        return $eventName;
    }
207029
public function fire($eventName, $subject = null)
    {
        if (!isset($this->events[$eventName])) {
            return $subject;
        }

        $event = new Event($eventName, $subject);

        foreach ($this->events[$eventName] as $listener) {
            if ($event->isStopped()) {
                break;
            }

            $listener($event);
        }

        return $event->getSubject();
    }
1143160
protected function fireEvent($eventName, Event $event)
    {
        if (!$this->eventDispatcher) {
            throw new \BadMethodCallException(sprintf(
                'Method %s() cannot be used while event dispatcher is not configured.',
                __METHOD__
            ));
        }

        $this->eventDispatcher->dispatch($eventName, $event);
    }
693271
public function exportEventMessages($eventName) {
        $exports = array();
        $items = $this->getEventMessages($eventName);
        foreach ($items as $item) {
            $exports[] = $this->prepareExportEventMessage($item);
        }
        return $exports;
    }
656524
protected function getMatchedQueue(
        /*# : string */ $eventName
    )/*# : EventQueueInterface */ {
        if ($this->hasEvent($eventName)) {
            return $this->events[$eventName];
        } else {
            return $this->newEventQueue();
        }
    }
1076349
public function handleEvent( $eventName )
	{
		$counter	= 0;
		if( !array_key_exists( $eventName, $this->callbacks ) )
			return $counter;
		foreach( $this->callbacks[$eventName] as $callback )
		{
			extract( $callback );
			$factory	= new Alg_Object_MethodFactory;												//  build a new Method Factory
			$factory->callObjectMethod( $object, $methodName, $methodParameters );
			$counter++;																				//  increase Callback Counter
			$this->counter++;																		//  increase total Callback Counter
		}
		return $counter;
	}
415008
public function dispatch($eventName, Event $event)
    {
        if (!$this->hasListeners($eventName)) {
            return $event;
        }

        // setting event name
        $event->setName($eventName);

        // execute all callbacks for a event given
        foreach ($this->getListeners($event->getName()) as $listener) {
            call_user_func($listener, $event);

            if ($event->isPropagationStopped()) {
                break;
            }
        }

        return $event;
    }
581030
protected function getHandlers($eventName)
    {
        return isset($this->events[$eventName]) ? $this->events[$eventName] : new CallbackQueue();
    }
190945
public function send(RequestEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
    {
        // Preparation of request parameters / Possibility to use for logging and caching etc.
        $eventDispatcher->dispatch(TmdbEvents::BEFORE_REQUEST, $event);

        if ($event->isPropagationStopped() && $event->hasResponse()) {
            return $event->getResponse();
        }

        $response = $this->sendRequest($event);
        $event->setResponse($response);

        // Possibility to cache the request
        $eventDispatcher->dispatch(TmdbEvents::AFTER_REQUEST, $event);

        return $response;
    }