src/Api/BaseApi.php
private function sanitizeQuery($query)
    {
        $parts = parse_url($query);
        $path  = $parts['path'];

        if (!isset($parts['query'])) {
            return $query;
        }

        $vars = explode('&', $parts['query']);

        $final = [];

        if (!empty($vars)) {
            foreach ($vars as $var) {
                $parts = explode('=', $var);

                $key = $parts[0];
                $val = $parts[1];

                if (!array_key_exists($key, $final) && !empty($val)) {
                    $final[$key] = $val;
                }
            }
        }

        return $path . '?' . http_build_query($final);
    }
private function sanitizeQuery($query)
    {
        $parts = parse_url($query);
        $path  = $parts['path'];

        if (!isset($parts['query'])) {
            return $query;
        }

        $vars = explode('&', $parts['query']);

        $final = [];

        if (!empty($vars)) {
            foreach ($vars as $var) {
                $parts = explode('=', $var);

                $key = $parts[0];
                $val = $parts[1];

                if (!array_key_exists($key, $final) && !empty($val)) {
                    $final[$key] = $val;
                }
            }
        }

        return $path . '?' . http_build_query($final);
    }
private function sanitizeQuery ( $ query ) { $ parts = parse_url ( $ query ) ; $ path = $ parts [ 'path' ] ; if ( ! isset ( $ parts [ 'query' ] ) ) { return $ query ; } $ vars = explode ( '&' , $ parts [ 'query' ] ) ; $ final = [ ] ; if ( ! empty ( $ vars ) ) { foreach ( $ vars as $ var ) { $ parts = explode ( '=' , $ var ) ; $ key = $ parts [ 0 ] ; $ val = $ parts [ 1 ] ; if ( ! array_key_exists ( $ key , $ final ) && ! empty ( $ val ) ) { $ final [ $ key ] = $ val ; } } } return $ path . '?' . http_build_query ( $ final ) ; }
removes empty query string parameters.

@param string $query

@return string
removes empty query string parameters .