Send HTTP-status
@param  integer $code Code
@throws RequestHeadersAlreadySent
@return boolean Success
499031
public function status($code = 200)
    {
        if (!isset(self::$codes[$code])) {
            return false;
        }
        $this->header($code . ' ' . self::$codes[$code]);
        return true;
    }
932644
public function status( $code = null ) 
	{
		if ( !is_null( $code ) ) 
		{
			if ( headers_sent() && !CLI ) 
			{
				throw new CCException( "CCResponse::status - cannot change status header has already been send." );
			}

			$this->_status = $code; return $this;
		}

		return $this->_status;
	}
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;
    }
1190234
public static function _sendHTTPStatusCode($code, $customDescription = FALSE) {
        if (!preg_match('/\d\d\d/', $code)) {
            _Log::warn("Invalid status code: $code - Using default '200 OK' response");
            $code = 200;
        }

        if ($customDescription === FALSE) {
            $description = isset(_WebResponseIncludes::$STATUS_CODES[$code]) ? _WebResponseIncludes::$STATUS_CODES[$code] : '';
        } else {
            $description = $customDescription;
        }
        header("HTTP/1.0 $code $description");
    }
1368810
public static function isRedirection(int $statusCode): bool
    {
        return ($statusCode >= HttpStatus::REDIRECTION) && ($statusCode < HttpStatus::CLIENT_ERROR);
    }
600634
public function status($code)
    {
        if (in_array((int) $code, array_keys(self::$header), true)) {
            $this->code = $code;

            @header('HTTP/1.1 '. $code .' '. self::$header[$code], $this->override, $code);
        }

        return $this;
    }
1139168
public function sendAndExit($code = null, array $headers = null)
    {
        $this->send($code, $headers);
        exit();
    }
1350903
protected function setResponseStatus(int $code, string $reasonPhrase = '') : void
    {
        $this->response = $this->response->withStatus($code, $reasonPhrase);
    }
518029
public function setStatus(int $statusCode): Response
	{
		if(isset($this->statusCodes[$statusCode]))
		{
			$this->statusCode = $statusCode;
		}

		return $this;
	}
630528
protected function _setStatus($code, $reasonPhrase = '')
    {
        if (!isset($this->_statusCodes[$code])) {
            throw new InvalidArgumentException(sprintf(
                'Invalid status code: %s. Use a valid HTTP status code in range 1xx - 5xx.',
                $code
            ));
        }

        $this->_status = $code;
        if (empty($reasonPhrase)) {
            $reasonPhrase = $this->_statusCodes[$code];
        }
        $this->_reasonPhrase = $reasonPhrase;
        $this->_setContentType();
    }
970019
public function response($content, $code)
    {
        $this->setJsonHeader();

        $this->setStatusCode($code);

        return $this->content($this->serializer->serialize($content));
    }
1026316
public function success(array $data = [], $status = 200, $code = 'success', array $headers = [], $options = 0)
    {
        return $this->respond($data, $status, $code, $headers, $options);
    }
352666
public function setStatusCode($code)
    {
        if (!is_int($code) || ($code < 100) || ($code > 599)) {
            throw new \BedRest\Rest\Exception("Invalid HTTP response code.");
        }

        $this->statusCode = $code;
    }
768210
public function sendHeader($message, $code = null)
    {
        if (!($this->request instanceof WebRequest)) {
            return;
        }
        
        if ($code !== null) {
            header($message, true, $code);
        } else {
            header($message);
        }
    }
820699
public function header( $code = 200 ) {

		if ( ! is_array( $code ) ) {
			$code = array( $code );
		}

		self::$header = array();

		foreach ( $code as $value ) {

			if ( is_int( $value ) ) {
				self::$header[] = $_SERVER["SERVER_PROTOCOL"] . ' ' . Route::$HttpResponse[ $value ];
			} else {
				self::$header[] = $value;
			}

		}

	}
561533
public function send($code = null, array $headers = null, $compress = false)
    {
        if ($code !== null) {
            $this->withStatus($code);
        }
        if ($headers !== null) {
            $this->setHeaders($headers);
        }

        $body = $this->body;
        $this->headers['Content-Length'] = strlen($body);

        if ($compress === true) {
            $encoding = '';
            if (preg_match('/ *gzip *,?/', $this->headers['accept-encoding'])) {
                $encoding = 'gzip';
            } elseif (preg_match('/ *deflate *,?/', $this->headers['accept-encoding'])) {
                $encoding = 'deflate';
            }
            (isset($encoding)) ? $this->headers['Content-Encoding'] = $encoding : null;
            $body = static::encodeBody($body, $encoding);
        }
        $this->sendHeaders();
        echo $body;
    }
579335
public function send()
    {
        header(
            sprintf(
                'HTTP/1.1 %s %s',
                $this->statusCode,
                self::codeToReason($this->statusCode)
            )
        );
        foreach ($this->headers as $k => $v) {
            header(
                sprintf('%s: %s', $k, $v)
            );
        }
        echo $this->body;
    }