protected function prepareActionRequest(ComponentContext $componentContext)
    {
        $httpRequest = $componentContext->getHttpRequest();
        $arguments = $httpRequest->getArguments();

        $parsedBody = $this->parseRequestBody($httpRequest);
        if ($parsedBody !== []) {
            $arguments = Arrays::arrayMergeRecursiveOverrule($arguments, $parsedBody);
            $httpRequest = $httpRequest->withParsedBody($parsedBody);
        }


        $routingMatchResults = $componentContext->getParameter(Routing\RoutingComponent::class, 'matchResults');
        if ($routingMatchResults !== null) {
            $arguments = Arrays::arrayMergeRecursiveOverrule($arguments, $routingMatchResults);
        }

        /** @var $actionRequest ActionRequest */
        $actionRequest = $this->objectManager->get(ActionRequest::class, $httpRequest);

        $actionRequest->setArguments($arguments);
        $this->securityContext->setRequest($actionRequest);
        $componentContext->replaceHttpRequest($httpRequest);

        $componentContext->setParameter(DispatchComponent::class, 'actionRequest', $actionRequest);

        return $componentContext;
    }
protected function prepareActionRequest(ComponentContext $componentContext)
    {
        $httpRequest = $componentContext->getHttpRequest();
        $arguments = $httpRequest->getArguments();

        $parsedBody = $this->parseRequestBody($httpRequest);
        if ($parsedBody !== []) {
            $arguments = Arrays::arrayMergeRecursiveOverrule($arguments, $parsedBody);
            $httpRequest = $httpRequest->withParsedBody($parsedBody);
        }


        $routingMatchResults = $componentContext->getParameter(Routing\RoutingComponent::class, 'matchResults');
        if ($routingMatchResults !== null) {
            $arguments = Arrays::arrayMergeRecursiveOverrule($arguments, $routingMatchResults);
        }

        /** @var $actionRequest ActionRequest */
        $actionRequest = $this->objectManager->get(ActionRequest::class, $httpRequest);

        $actionRequest->setArguments($arguments);
        $this->securityContext->setRequest($actionRequest);
        $componentContext->replaceHttpRequest($httpRequest);

        $componentContext->setParameter(DispatchComponent::class, 'actionRequest', $actionRequest);

        return $componentContext;
    }
protected function prepareActionRequest ( ComponentContext $ componentContext ) { $ httpRequest = $ componentContext -> getHttpRequest ( ) ; $ arguments = $ httpRequest -> getArguments ( ) ; $ parsedBody = $ this -> parseRequestBody ( $ httpRequest ) ; if ( $ parsedBody !== [ ] ) { $ arguments = Arrays :: arrayMergeRecursiveOverrule ( $ arguments , $ parsedBody ) ; $ httpRequest = $ httpRequest -> withParsedBody ( $ parsedBody ) ; } $ routingMatchResults = $ componentContext -> getParameter ( Routing \ RoutingComponent :: class , 'matchResults' ) ; if ( $ routingMatchResults !== null ) { $ arguments = Arrays :: arrayMergeRecursiveOverrule ( $ arguments , $ routingMatchResults ) ; } /** @var $actionRequest ActionRequest */ $ actionRequest = $ this -> objectManager -> get ( ActionRequest :: class , $ httpRequest ) ; $ actionRequest -> setArguments ( $ arguments ) ; $ this -> securityContext -> setRequest ( $ actionRequest ) ; $ componentContext -> replaceHttpRequest ( $ httpRequest ) ; $ componentContext -> setParameter ( DispatchComponent :: class , 'actionRequest' , $ actionRequest ) ; return $ componentContext ; }
Create ActionRequest with arguments from body and routing merged and add it to the component context.

TODO: This could be a separate HTTP component (ActionRequestFactoryComponent) that sits in the chain before the DispatchComponent.

@param ComponentContext $componentContext
@return ComponentContext
Create ActionRequest with arguments from body and routing merged and add it to the component context .