public function convertSymfonyRequest(SymfonyRequest $request)
    {
        $session = $request->getSession();
        if ($session) {
            $session = $session->all();
        } else {
            $session = [];
        }

        // decode request parameters
        $parameters = $request->request->all();
        if (in_array($request->getMethod(), ['POST', 'PUT', 'PATCH']) && 'json' == $request->getContentType()) {
            $parameters = json_decode($request->getContent(), true);
        }

        // NOTE: This is not entirely accurate to use $_FILES, however,
        // because Symfony converts $_FILES into an UploadedFile object
        // and Infuse expects the raw array, it makes compatibility difficult.
        $req = new Request($request->query->all(), $parameters, $request->cookies->all(), $_FILES, $request->server->all(), $session);
        $req->setParams($request->attributes->all());

        return $req;
    }