original_string: protected function createJsonResponseForException(UserException $exception)
      {
          $message = $exception->getMessage();
          $statusCode = $exception->getStatusCode();
          $content = ['error' => str_replace('"', '\'', $message)];
  
          return new JsonResponse($content, $statusCode);
      }
code: protected function createJsonResponseForException(UserException $exception)
      {
          $message = $exception->getMessage();
          $statusCode = $exception->getStatusCode();
          $content = ['error' => str_replace('"', '\'', $message)];
  
          return new JsonResponse($content, $statusCode);
      }
code_tokens: protected function createJsonResponseForException ( UserException $ exception ) { $ message = $ exception -> getMessage ( ) ; $ statusCode = $ exception -> getStatusCode ( ) ; $ content = [ 'error' => str_replace ( '"' , '\'' , $ message ) ] ; return new JsonResponse ( $ content , $ statusCode ) ; }
docstring: Create JsonResponse for Exception.
  
  @param UserException $exception
  
  @return JsonResponse
docstring_tokens: Create JsonResponse for Exception .