Sets the HTTP status code

@param integer $code  The status code

@return self
175969
public function setStatusCode($code)
	{
		if (!array_key_exists($code, self::$statusCodeMap)) {
			throw new InvalidArgumentException(sprintf('The HTTP stauts code %s is unknown.', $code));
		}

		$this->statusCode = $code;

		return $this;
	}
783583
public function setContent($content, $code = 200)
    {
        $this->content = $content ? $content : '';
        $this->statusCode = $code;
        if (!is_scalar($content)) {
            $this->toJson();
        }

        return $this;
    }
1252400
public function setStatusCode($code, $text = null)
    {
        $code = intval($code);
        if ($code < 100 || $code > 999)
        {
            throw new InvalidArgumentException('Status code must be from 100 to 999');
        }
        $this->status = $code;
        $this->statusText = $text;
        return $this;
    }
1101566
private function fixateCode(int $code): self
    {
        $this->setCode($code);
        $this->fixed = true;
        return $this;
    }
283901
public function code(int $code = 200) : Rest
  {
    $this->code = $code;
    header('HTTP/1.1 '.$this->code);
    return $this;
  }
554432
public function setStatuscode($v)
    {
        if ($v !== null && is_numeric($v)) {
            $v = (int) $v;
        }

        if ($this->statuscode !== $v) {
            $this->statuscode = $v;
            $this->modifiedColumns[] = RemoteHistoryContaoPeer::STATUSCODE;
        }


        return $this;
    }
479111
public function setStatus(int $statusCode):ResponseBuilder
    {
        if ($statusCode < 400 || $statusCode >= 600) {
            throw new InvalidArgumentException("{$statusCode} is not a valid error HTTP status code.");
        }
        return parent::setStatus($statusCode);
    }
485373
function success(int $code, string $body=''): \Nofuzz\Http\HTTPResponse
  {
    $this->setStatusCode($code);
    $this->setBody($body);

    return $this;
  }
1371718
public function setCode($code)
    {
        if (!is_scalar($code)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Wrong parameters for %s([int|string $code]); %s given.',
                    __METHOD__,
                    is_object($code) ? get_class($code) : gettype($code)
                ),
                E_ERROR
            );
        }

        $this->code = $code;

        return $this;
    }
1358633
public function setStatus($statusCode)
    {
        if ($this->statusCode === null) {
            $this->statusCode = $statusCode;
            $this->response->setStatusCode($statusCode);
        }
    }
901235
public function setStatus($code, $reasonPhrase = null)
    {
        $this->statusCode   = $code;
        $this->reasonPhrase = $reasonPhrase;
    }
1020548
function responseCode($code = null) {
		if ($code === null) {
			return $this->http_response_code;
		}
		else { // $code !== null, act as setter
			$this->http_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;
    }
985060
public function setStatus(int $code): Response
    {
        # `Status::getText` will throw an exception for invalid status codes
        $this->statusText = Status::getText($code);
        $this->statusCode = $code;
        return $this;
    }
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;
    }
741260
public static function send_status($code) {
	if (!isset(static::$status_messages[$code])) {
		$code = self::STATUS_INTERNAL_SERVER_ERROR;
	}
	
	http_response_code($code);
}
961373
public function setHttpCode($httpCode)
    {
        if (!array_key_exists($httpCode, $this->httpCodes)) {
            throw new \Parable\Http\Exception("Invalid HTTP code set: '{$httpCode}'");
        }
        $this->httpCode = $httpCode;
        return $this;
    }