code = $code; $this->msg = $msg; } public function set_and_exit() { http_response_code($this->code); echo $this->msg; exit; } public static function bad_request() { return new HttpResponse(400, 'Bad Request'); } public static function forbidden() { return new HttpResponse(403, 'Forbidden'); } public static function not_found() { return new HttpResponse(404, 'Not Found'); } public static function internal_server_error() { return new HttpResponse(500, 'Internal Server Error'); } }