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;
    }