public function merge($query): self
    {
        $pairs = $this->pairs;
        foreach (QueryString::parse($this->filterComponent($query), $this->separator, PHP_QUERY_RFC3986) as $pair) {
            $pairs = $this->addPair($pairs, $pair);
        }

        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = $pairs;

        return $clone;
    }
public function merge($query): self
    {
        $pairs = $this->pairs;
        foreach (QueryString::parse($this->filterComponent($query), $this->separator, PHP_QUERY_RFC3986) as $pair) {
            $pairs = $this->addPair($pairs, $pair);
        }

        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = $pairs;

        return $clone;
    }
public function merge ( $ query ) : self { $ pairs = $ this -> pairs ; foreach ( QueryString :: parse ( $ this -> filterComponent ( $ query ) , $ this -> separator , PHP_QUERY_RFC3986 ) as $ pair ) { $ pairs = $ this -> addPair ( $ pairs , $ pair ) ; } if ( $ pairs === $ this -> pairs ) { return $ this ; } $ clone = clone $ this ; $ clone -> pairs = $ pairs ; return $ clone ; }
Returns an instance with the new pairs set to it.

This method MUST retain the state of the current instance, and return
an instance that contains the modified query

@see ::withPair
Returns an instance with the new pairs set to it .