Emits a signal when a Request has been dispatched

The action request is not proxyable, so the signal is dispatched manually here.
The safeguard allows unit tests without the dispatcher dependency.

@param ActionRequest $request
@return void
@Flow\Signal
439921
protected function emitRequestDispatched($request)
    {
        if ($this->objectManager !== null) {
            $dispatcher = $this->objectManager->get(SignalSlotDispatcher::class);
            if ($dispatcher !== null) {
                $dispatcher->dispatch(ActionRequest::class, 'requestDispatched', [$request]);
            }
        }
    }
1139257
public function onPostDispatch(ActionDispatchEvent $event)
    {
        $message = sprintf(
            'Complete handle API method "%s". Response object: %s',
            $event->getAction()->getName(),
            get_class($event->getResponse())
        );

        $this->logger->debug($message);
    }
1118403
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getModel();

        $result = $this->api->approve($payment->getId(), $payment->getTargetAmount());

        if ($exception = $result->getPluginException()) {
            if ($exception instanceof ActionRequiredException) {
                if ($exception->getAction() instanceof VisitUrl) {
                    throw new HttpRedirect($exception->getAction()->getUrl());
                }

                throw new \LogicException(sprintf(
                    'The given action required exception %s could not be converted to payum\'s reply.',
                    get_class($exception)
                ), null, $exception);
            }

            throw $exception;
        }
    }
1164381
public function authenticate($request) {
		if(!$this->configured)
			return;
		
		$this->checkValidity();
		
		if($this->via == self::HTTP_HEADER)
			$request->addHeader($this->description->http_header, $this->token);
	}
1187462
public function resolveRequest(Request $request, $action = null)
    {
        $this->setDirPath($request->get('dir_path'));

        $this->setCurrentFile($this->getPath($this->getDirPath(), $request->get('filename'), true));

        if ($action === self::FILE_RENAME && !$this->getCurrentFile()->isDir()) {
            $extension = $this->getCurrentFile()->getExtension();
            $target_file = $request->get('target_file') . "." . $extension;
        } elseif ($action === self::FILE_PASTE) {

            $sources = $this->container->get('session')->get('copy');
            $this->setCurrentFile($sources['source_dir'] . FileManager::DS . $sources['source_file']);
            $target_file = $request->get('target_file') . FileManager::DS . $sources['source_file'];
        } else {
            $target_file = $request->get('target_file');
        }

        if (isset($target_file)) {
            $this->setTargetFile($target_file);
        }
    }
1261442
public function handleClientRequest($request)
    {
        $this->client_data->path = $request->server['path_info'];
        $route = explode('/', $request->server['path_info']);
        $count = count($route);
        if ($count == 2) {
            $this->client_data->controller_name = $route[$count - 1] ?? null;
            $this->client_data->method_name = null;
            return;
        }
        $this->client_data->method_name = $route[$count - 1] ?? null;
        unset($route[$count - 1]);
        unset($route[0]);
        $this->client_data->controller_name = implode("\\", $route);
    }
467700
public function handleAction(ActionEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $this->checkLanguage($event->getEnvironment(), 'create' === $event->getAction()->getName());
    }
424130
public function handleRequest($request)
    {
        list ($route, $params) = $request->resolve();
        $this->requestedRoute = $route;
        $result = $this->runAction($route, $params);
        if ($result instanceof Response) {
            return $result;
        } else {
            $response = $this->getResponse();
            $response->exitStatus = $result;

            return $response;
        }
    }
292091
public function dispatch(ServerRequestInterface $request)
    {
        if ($this->routeMatched) {
            if (!is_subclass_of($this->actionNamespace, 'App\Action\AppAction')) {
                throw new BaseException(
                    sprintf('Action "%s" does not extend App\Action\AppAction', $this->actionNamespace)
                );
            }

            $actionInstance = new $this->actionNamespace();

            $beforeDispatchEvent = $this->dispatchEvent(
                self::EVENT_BEFORE_DISPATCH,
                $this,
                ['request' => $request, 'action' => $actionInstance]
            );

            if ($beforeDispatchEvent->getResult() instanceof Response) {
                return $beforeDispatchEvent->getResult();
            }

            $response = call_user_func_array([$actionInstance, 'invoker'], $this->params);
            $this->dispatchEvent(self::EVENT_AFTER_DISPATCH, $this, ['request' => $request, 'response' => $response]);

            return $response;
        } else {
            throw new NotFoundException(
                sprintf('Route "%s" does not found', $request->getServerParams()['REQUEST_URI'])
            );
        }
    }
401296
public function dispatch(Request $request)
	{
		$this->currentRequest = $request;

		// If no response was returned from the before filter, we will call the proper
		// route instance to get the response. If no route is found a response will
		// still get returned based on why no routes were found for this request.
		$response = $this->callFilter('before', $request);

		if (is_null($response))
		{
			$response = $this->dispatchToRoute($request);
		}

		// Once this route has run and the response has been prepared, we will run the
		// after filter to do any last work on the response or for this application
		// before we will return the response back to the consuming code for use.
		$response = $this->prepareResponse($request, $response);

		$this->callFilter('after', $request, $response);

		return $response;
	}
812287
public function dispatch(Request $request)
    {
        $url = $request->getQueryString();
        $url = $this->RemoveQueryString($url, new Request());
        if ($this->match($url)) {
            (isset($this->params['middleware'])) ? $this->params['middleware'] = new $this->params['middleware']() : null;
            if (!isset($this->params['callable'])) {
                $controller = $this->params['controller'];
                $controller = $this->convertToStudlyCaps($controller);
                $controller = $this->getNamespace().$controller;
                if (class_exists($controller)) {
                    (isset($this->params['middleware']) && is_object($this->params['middleware'])) ? ( new $this->params['middleware']())->before(new Request(), new Response(), $this->params) : null;
                    $controller_object = new $controller($this->params, $this->getInput(new Input()));
                    $action = $this->params['action'];
                    $action = $this->convertToCamelCase($action);
                    if (preg_match('/action$/i', $action) == 0) {
                        $controller_object->$action();
                        (isset($this->params['middleware']) && is_object($this->params['middleware'])) ? (new $this->params['middleware']())->after(new Request(), new Response(), $this->params) : null;
                    } else {
                        throw new \Exception("Method $action in controller $controller cannot be called directly - remove the Action suffix to call this method");
                    }
                } else {
                    throw new \Exception("Controller class $controller not found");
                }
            } else {
                (is_object(isset($this->params['middleware']))) ? $this->params['middleware']->before(new Request(), new Response(), $this->params) : null;
                call_user_func($this->params['callable'], $this->params);
                (is_object(isset($this->params['middleware']))) ? $this->params['middleware']->after(new Request(), new Response(), $this->params) : null;
            }
        } else {
            \Zest\Component\Router::loadComponents();
        }
    }
285870
public function dispatch(Request $request)
    {
        $this->authorize($request);

        return $this->next->dispatch($request);
    }
950282
public function startJob(ExecuteJobRequest $request)
    {
        $this->worker->setState(Worker::BUSY);

        $requestId = $request->getRequestId();
        $action    = $request->getAction();
        if (!$this->worker->hasAction($action)) {
            $this->getLogger()->debug('Action '.$action.' not found.');
            $this->sendToWorkerHandler(new ActionNotFound($requestId, $action));

            return;
        }

        $this->getLogger()->debug('Sending new request ('.$requestId.') to action '.$action);
        $this->serviceStream->send($request);
    }
1198683
public function dispatchToRoute(Request $request)
    {
        // First we will find a route that matches this request. We will also set the
        // route resolver on the request so middlewares assigned to the route will
        // receive access to this route instance for checking of the parameters.
        $route = $this->findRoute($request);
        $request->setRouteResolver(function () use ($route) {
            return $route;
        });
        $this->events->fire('router.matched', [$route, $request]);
        
        if (is_null($response)) {
            $response = $this->runRouteWithinStack(
                $route, $request
            );
        }
        
        return $this->prepareResponse($request, $response);
    }
1331261
public function handleRequest(ServerRequestInterface $request)
    {
        $applicationEvent = $this->getApplicationEvent();
        $applicationEvent->setName(self::EVENT_REQUEST_RECEIVED);
        $this->emit($applicationEvent, $request);

        return $applicationEvent->getRequest();
    }
1123415
protected function forwardToRequest(ActionRequest $request)
    {
        $packageKey = $request->getControllerPackageKey();
        $subpackageKey = $request->getControllerSubpackageKey();
        if ($subpackageKey !== null) {
            $packageKey .= '\\' . $subpackageKey;
        }
        $this->forward($request->getControllerActionName(), $request->getControllerName(), $packageKey, $request->getArguments());
    }
904422
public function beforeSend($request)
    {
        $event = new RequestEvent();
        $event->request = $request;
        $this->trigger(self::EVENT_BEFORE_SEND, $event);
    }