public function append($query): self
    {
        if ($query instanceof UriComponentInterface) {
            $query = $query->getContent();
        }

        $pairs = array_merge($this->pairs, QueryString::parse($query, $this->separator, PHP_QUERY_RFC3986));
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = array_filter($pairs, [$this, 'filterEmptyValue']);

        return $clone;
    }
public function append($query): self
    {
        if ($query instanceof UriComponentInterface) {
            $query = $query->getContent();
        }

        $pairs = array_merge($this->pairs, QueryString::parse($query, $this->separator, PHP_QUERY_RFC3986));
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = array_filter($pairs, [$this, 'filterEmptyValue']);

        return $clone;
    }
public function append ( $ query ) : self { if ( $ query instanceof UriComponentInterface ) { $ query = $ query -> getContent ( ) ; } $ pairs = array_merge ( $ this -> pairs , QueryString :: parse ( $ query , $ this -> separator , PHP_QUERY_RFC3986 ) ) ; if ( $ pairs === $ this -> pairs ) { return $ this ; } $ clone = clone $ this ; $ clone -> pairs = array_filter ( $ pairs , [ $ this , 'filterEmptyValue' ] ) ; return $ clone ; }
Returns an instance with the new pairs appended to it.

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

If the pair already exists the value will be added to it.
Returns an instance with the new pairs appended to it .