Symfony\Component\HttpFoundation\Response::create PHP Method

create() public static method

Example: return Response::create($body, 200) ->setSharedMaxAge(300);
public static create ( mixed $content = '', integer $status = 200, array $headers = [] ) : Response
$content mixed The response content, see setContent()
$status integer The response status code
$headers array An array of response headers
return Response
    public static function create($content = '', $status = 200, $headers = array())
    {
        return new static($content, $status, $headers);
    }

Usage Example

 public function __invoke(Request $request)
 {
     if ($this->service->delete($request->getRequestURI()) === false) {
         throw new ServiceUnavailableHttpException(null, "Failed to delete resource");
     }
     return Response::create("", Response::HTTP_NO_CONTENT);
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Response::create