Icicle\Http\Message\BasicResponse::withStatus PHP Method

withStatus() public method

public withStatus ( integer $code, string $reason = null ) : Icicle\Http\Message\Response
$code integer
$reason string
return Icicle\Http\Message\Response
    public function withStatus(int $code, string $reason = null) : Response
    {
        $new = clone $this;
        $new->status = $new->validateStatusCode($code);
        $new->reason = $new->filterReason($reason);
        return $new;
    }