src/Payum/Core/Security/AbstractTokenFactory.php
protected function addQueryToUri(HttpUri $uri, array $query)
    {
        $query = array_replace((new QueryParser())->parse($uri->getQuery()), $query);
        $query = array_filter($query, function ($value) {
            return null !== $value;
        });

        return $uri->withQuery((string) Query::createFromPairs($query));
    }
protected function addQueryToUri(HttpUri $uri, array $query)
    {
        $query = array_replace((new QueryParser())->parse($uri->getQuery()), $query);
        $query = array_filter($query, function ($value) {
            return null !== $value;
        });

        return $uri->withQuery((string) Query::createFromPairs($query));
    }
@param HttpUri $uri
@param array $query

@return HttpUri