protected function createResponse($content = '', $statusCode = 200, $contentType = 'application/json')
    {
        if ('' === $content && 'application/json' === $contentType) {
            $content = '{}';
        }

        $response = new Response($content, $statusCode);
        $response->headers->set('Content-Type', $contentType);

        return $response;
    }
protected function createResponse($content = '', $statusCode = 200, $contentType = 'application/json')
    {
        if ('' === $content && 'application/json' === $contentType) {
            $content = '{}';
        }

        $response = new Response($content, $statusCode);
        $response->headers->set('Content-Type', $contentType);

        return $response;
    }
protected function createResponse ( $ content = '' , $ statusCode = 200 , $ contentType = 'application/json' ) { if ( '' === $ content && 'application/json' === $ contentType ) { $ content = '{}' ; } $ response = new Response ( $ content , $ statusCode ) ; $ response -> headers -> set ( 'Content-Type' , $ contentType ) ; return $ response ; }
Create a RESTful response.

@return \Symfony\Component\HttpFoundation\Response
Create a RESTful response .