private function modifyRequestAttributes(RouteMatchInterface $routeMatch, ServerRequestInterface $request): ServerRequestInterface
    {
        if ($routeMatch->isMethodFailure() === true) {
            return $request
                ->withAttribute('actionName', self::METHOD_NOT_ALLOWED_ACTION)
                ->withAttribute('allowedMethods', $routeMatch->getAllowedMethods());
        }

        if ($routeMatch->isFailure() === true) {
            return $request->withAttribute('actionName', self::ROUTE_NOT_FOUND_ACTION);
        }

        return $request
            ->withAttribute('actionName', $routeMatch->getAction())
            ->withAttribute('parameters', $routeMatch->getParameters());
    }