public function withStatus($code, $reason = '')
    {
        // TODO: Add \InvalidArgumentException

        $static = clone $this;

        $static->code = $code;

        $static->reason = $reason ?: $static->codes[$code];

        return $static;
    }
public function withStatus($code, $reason = '')
    {
        // TODO: Add \InvalidArgumentException

        $static = clone $this;

        $static->code = $code;

        $static->reason = $reason ?: $static->codes[$code];

        return $static;
    }
Returns an instance with the specified status code and, optionally, reason phrase.

@param  integer $code
@param  string  $reason
@return static

@throws \InvalidArgumentException