@param KernelEvent $event

@return mixed
@throws ReflectionException
321494
private function getAnnotation(KernelEvent $event): ?Cache
    {
        $controller = $this->getController($event);
        $controllerClass = new ReflectionClass($controller[0]);

        if ($method = $controllerClass->getMethod($controller[1])) {
            return $this->reader->getMethodAnnotation($method, Cache::class);
        }

        return null;
    }
745575
protected function raiseEvent($event)
    {
        if (!isset($this->eventHandlers[$event])) {
            return null;
        }

        $args = func_get_args();
        $args = array_slice($args, 1);

        // Check if the last argument is a callback.
        $count = count($args);
        $callBack = false;

        if (($count > 0) && is_object($args[$count - 1]) && is_callable($args[$count - 1])) {
            $callBack = $args[$count - 1];
            $args = array_slice($args, 0, -1);
        }

        $result = null;

        foreach ($this->eventHandlers[$event] as $delegate) {
            $answer = call_user_func_array($delegate, $args);

            if ($callBack !== false && $answer !== null) {
                call_user_func($callBack, $answer);
            }

            // If we don't have a result yet - make this the result. This way the first event handler to
            // return a non null result will be the overall result of the event.
            if ($result === null) {
                $result = $answer;
            }
        }

        return $result;
    }
1101721
protected function getEventObject($event, $data)
    {
        $eventClass = new ReflectionClass($this->getEventClass($event));

        return $eventClass->newInstanceArgs($data);
    }
485387
public function handle($event)
    {
        $method = $this->getMethodFor($event);

        if (method_exists($this, $method)) {
            return call_user_func([$this, $method], $event);
        }
    }
688826
public function load(\Zend_EventManager_EventDescription $event)
    {
        if(false !== ($content = $this->cache->load($this->_getIdentifier($event)))) {
            $event->stopPropagation(true);
            return $content;
        }
    }
1305733
private function addEvent($event)
    {
        if (is_string($event)) {
            $event = Event::named($event);
        }

        if (!$event instanceof EventInterface) {
            throw new \InvalidArgumentException(
                'Events should be provides as Event instances or string, received type: ' . gettype($event)
            );
        }

        $this->events[] = $event;

        return $event;
    }
915361
public function dispatch($event/*, string $eventName = null*/)
    {
        $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;

        if (\is_object($event)) {
            $eventName = $eventName ?? \get_class($event);
        } else {
            @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED);
            $swap = $event;
            $event = $eventName ?? new Event();
            $eventName = $swap;

            if (!$event instanceof Event) {
                throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
            }
        }

        $listeners = $this->getListeners($eventName);
        $stoppable = $event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;

        foreach ($listeners as $listener) {
            if ($stoppable && $event->isPropagationStopped()) {
                break;
            }
            $listener($event, $eventName, $this);
        }

        return $event;
    }
1363062
public function getEvent(string $event)
    {
        $class = (string)$this->sprintf(':namespace\Event\:event', __NAMESPACE__, $event);

        if (class_exists($class)) {
            return new $class($this);
        }

        return null;
    }
414265
protected static function getConsoleDir( Event $event )
	{
		$options = self::getOptions( $event );

		$bindir = 'bin';

		if( isset( $options['symfony-app-dir'] ) && is_dir( $options['symfony-app-dir'] ) ) {
			$bindir = $options['symfony-app-dir'];
		}

		if( isset( $options['symfony-bin-dir'] ) && is_dir( $options['symfony-bin-dir'] ) ) {
			$bindir = $options['symfony-bin-dir'];
		}

		return $bindir;
	}
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;
    }
182658
public function resolve($event)
    {
        if ($event instanceof UserEvent) {
            return $this->getEventDetailsArray($event->getUser()->getUsername());
        }

        return null;
    }
188761
protected function event(HttpException $event, Context $context = null)
    {
        $code = $event->getCode();
        if(isset($this->events[$code])) {
            $context->error = $event;
            $context->response->code = $event->getCode();
            $this->logger->debug('kernel.event: http ' . $code . ' event raised, has callback');
            return $context->forward($this->events[$code], $event);
        }

        $this->logger->debug('kernel.event: http ' . $code . ' event raised, no callback');
        throw $event;
    }
916479
public function getNotificationsEmail($event)
    {
        $notificationEmailRepository = $this->getContainer()->get('doctrine')->getRepository(
            'CompoNotificationBundle:NotificationEmail'
        );

        return $notificationEmailRepository->findBy(['event' => $event]);
    }
675307
private function check(KernelEvent $event): bool
    {
        if (!$this->enabled || !$this->client || !$event->isMasterRequest()) {
            return false;
        }

        if (method_exists($event, 'getResponse') && $event->getResponse() && !$event->getResponse()->isSuccessful()) {
            return false;
        }

        if (empty($controller = $this->getController($event)) || !class_exists($controller[0])) {
            return false;
        }

        return true;
    }
1025829
private function parseName($event)
    {
        if ($event instanceof EventEnvelopeInterface) {
            return $event->getEventName();
        }

        if (is_object($event)) {
            $class = get_class($event);
        } elseif (is_string($event)) {
            $class = $event;
        } else {
            throw new \InvalidArgumentException(sprintf('Cannot parse name for type %s', gettype($event)));
        }

        if (substr($class, -5) === 'Event') {
            $class = substr($class, 0, -5);
        }

        $parts = explode('\\', $class);

        return end($parts);
    }
525054
protected function getEventHandlers($event)
    {
        $logger = $this->getLogger();
        $handlers = array();

        foreach ($this->plugins as $plugin) {
            $callbacks = $plugin->getSubscribedEvents();
            if (!is_array($callbacks)) {
                $logger->warning('Plugin returns non-array value for event callbacks', array(
                    'plugin' => get_class($plugin),
                    'callbacks' => $callbacks,
                ));
                continue;
            }
            if (!isset($callbacks[$event])) {
                $logger->debug('Plugin does not handle event', array(
                    'plugin' => get_class($plugin),
                    'event' => $event,
                ));
                continue;
            }
            $callback = $callbacks[$event];
            $pluginCallback = array($plugin, $callback);
            if (is_callable($pluginCallback)) {
                $handlers[] = $pluginCallback;
            } elseif (is_callable($callback)) {
                $handlers[] = $callback;
            } else {
                $logger->warning('Plugin returns invalid event callback', array(
                    'plugin' => get_class($plugin),
                    'event' => $event,
                    'callback' => $callback,
                ));
            }
        }

        return $handlers;
    }
1345119
public function get_group(event_interface $event) {
        if (is_null($this->groups)) {
            $this->load_groups();
        }

        if ($group = $event->get_group()) {
            $groupid = $group->get('id');
            return isset($this->groups[$groupid]) ? $this->groups[$groupid] : null;
        } else {
            return null;
        }
    }