public function withMethod($method) { $this->validateMethod($method); $new = clone $this; $new->method = $method; return $new; }