public function withQueryParams(array $query) { $new = clone $this; $new->queryParams = $query; return $new; }