Phly\Http\RequestTrait::withMethod PHP Method

withMethod() public method

While HTTP method names are typically all uppercase characters, HTTP method names are case-sensitive and thus implementations SHOULD NOT modify the given string. This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the changed request method.
public withMethod ( string $method ) : self
$method string Case-insensitive method.
return self
    public function withMethod($method)
    {
        $this->validateMethod($method);
        $new = clone $this;
        $new->method = $method;
        return $new;
    }