Set the HTTP status code

@param  int $code
@return bool
328308
public function setHttpStatusCode($code)
    {
        $code = intval($code);
        if (!is_int($code)
            || $code < 100
            || $code > 599
        ) {
            trigger_error('Invalid HTTP status code, not taken into account.', E_USER_WARNING);
            return false;
        }
        $this->httpStatusCode = $code;
        return true;
    }
600841
public function setStatusCode($code, $message)
  {
    $this->meta->statusCode = $code;
    $this->meta->statusMessage = $message;
  }
1210082
public static function statusCode($code)
    {
        $status = [
            // Informational 1xx
            100 => 'Continue',
            101 => 'Switching Protocols',
            // Success 2xx
            200 => 'OK',
            201 => 'Created',
            202 => 'Accepted',
            203 => 'Non-Authoritative Information',
            204 => 'No Content',
            205 => 'Reset Content',
            206 => 'Partial Content',
            // Redirection 3xx
            300 => 'Multiple Choices',
            301 => 'Moved Permanently',
            302 => 'Moved Temporarily ',  // 1.1
            303 => 'See Other',
            304 => 'Not Modified',
            305 => 'Use Proxy',
            // 306 is deprecated but reserved
            307 => 'Temporary Redirect',
            // Client Error 4xx
            400 => 'Bad Request',
            401 => 'Unauthorized',
            402 => 'Payment Required',
            403 => 'Forbidden',
            404 => 'Not Found',
            405 => 'Method Not Allowed',
            406 => 'Not Acceptable',
            407 => 'Proxy Authentication Required',
            408 => 'Request Timeout',
            409 => 'Conflict',
            410 => 'Gone',
            411 => 'Length Required',
            412 => 'Precondition Failed',
            413 => 'Request Entity Too Large',
            414 => 'Request-URI Too Long',
            415 => 'Unsupported Media Type',
            416 => 'Requested Range Not Satisfiable',
            417 => 'Expectation Failed',
            // Server Error 5xx
            500 => 'Internal Server Error',
            501 => 'Not Implemented',
            502 => 'Bad Gateway',
            503 => 'Service Unavailable',
            504 => 'Gateway Timeout',
            505 => 'HTTP Version Not Supported',
            509 => 'Bandwidth Limit Exceeded'
        ];
        if (array_key_exists($code, $status)) {
            header('HTTP/1.1 ' . $code . ' ' . $status[$code]);
        }
    }
63902
protected function getStatusMessage($code)
    {
        return (
            isset($this->statusMessages[$code])
                ? $this->statusMessages[$code] : $this->statusMessages[500]
        );
    }
154088
public function setStatusCode($code)
    {
        $code = (int) $code;

        if (!array_key_exists($code, $this->validStatusCodes)) {
            throw new Exceptions\InvalidStatusCodeException(
                "'$code' is an invalid status code"
            );
        }

        $this->statusCode = $code;

        return $this;
    }
680560
public function setHttpCode($code)
    {
        $this->addHeader(new Header\Header('HTTP/1.1 ' . (int) $code . ' ' . Header\HttpCode::getText($code), true, (int) $code));

        return $this;
    }
518029
public function setStatus(int $statusCode): Response
	{
		if(isset($this->statusCodes[$statusCode]))
		{
			$this->statusCode = $statusCode;
		}

		return $this;
	}
283901
public function code(int $code = 200) : Rest
  {
    $this->code = $code;
    header('HTTP/1.1 '.$this->code);
    return $this;
  }
616564
public function setHttpResponseCode($code)
        {
            if (!is_int($code) || (100 > $code) || (599 < $code)) {
                throw new Exception('Invalid HTTP response code');
            }

            if ((300 <= $code) && (307 >= $code)) {
                $this->_isRedirect = true;
            } else {
                $this->_isRedirect = false;
            }

            $this->_httpResponseCode = $code;

            return $this;
        }
873083
public function setStatus(int $code, string $reason = null): self
    {
        if (!isset(ResponseMessage::$phrases[$code])) {
            throw new \InvalidArgumentException("The HTTP status code is not valid: {$code}");
        }

        $this->status = $code;

        if ($reason === null) {
            $reason = ResponseMessage::$phrases[$code];
        }
        $this->reason = $reason;

        return $this;
    }
1041938
public static function get( $code = 200 )
	{
		if( isset( self::$http_status_codes[$code] ) )
		{
			return( self::$http_status_codes[ $code ] );
		}
		return( false );
	}
754726
public function setHttpCode(int $code): Response
    {
        if ($this->response_finished) {
            return $this;

        }

        $this->response_code = $code;

        return $this;
    }
339156
public function withStatus($code, $reasonPhrase = '')
    {
        $this->statusCode = (int)$code;
        if ($reasonPhrase == '') {
            $this->reasonPhrase = Status::getReasonPhrase($this->statusCode);
        } else {
            $this->reasonPhrase = $reasonPhrase;
        }

        return $this;
    }
859686
public function setStatusCode($statusCode)
    {
        $statusCode = (int)$statusCode;
        if ($statusCode < 100 || $statusCode >= 600) {
            throw new \Exception("Invalid status code: {$statusCode}.");
        }
        $this->statusCode = $statusCode;
        return $this;
    }
1203361
public function statusCode($code = null, $reasonPhrase = null)
    {
        if (func_num_args() < 1 || empty($code)) {
            return $this->response->getStatusCode();
        }
        $this->response = $this->response->withStatus($code, $reasonPhrase);
        return $this;
    }
208786
public static function addStatus($code, $name)
    {
        self::$HTTP_STATUS_CODES[$code] = $name;
        self::addCodeName($name);
    }
951300
public function setStatus($code = 200, $text = '')
    {
        if (empty($code) or !is_numeric($code)) {
            throw new ResponseException('Status codes must be numeric.');
        }

        if (empty($text)) {
            if (!is_int($code)) {
                $code = (int) $code;
            }

            if (isset($this->httpCode[$code])) {
                $text = $this->httpCode[$code];
            } else {
                throw new ResponseException('No status text available. Please check your status code number or supply your own message text.');
            }
        }

        if (strpos(PHP_SAPI, 'cgi') === 0) {
            header('Status: ' . $code . ' ' . $text, true);
        } else {
            $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
            header($protocol . ' ' . $code . ' ' . $text, true, $code);
        }
    }