Ergo\Http\Request::copy PHP Method

copy() public method

Creates a new Request object with the parameters specified, or uses the current object's parameters
public copy ( $headers = false, $body = false, $url = false, $method = false ) : object
return object
    public function copy($headers = false, $body = false, $url = false, $method = false)
    {
        $copy = clone $this;
        if ($headers !== false) {
            $copy->_headers = new HeaderCollection($headers);
        }
        if ($body !== false) {
            $copy->_body = $body;
        }
        if ($url !== false) {
            $copy->_url = $url;
        }
        if ($method !== false) {
            $copy->_method = $method;
        }
        unset($copy->_querystring);
        return $copy;
    }