protected static function appendQuery(string $uri, array $query = []): string {
        if (!empty($query)) {
            $qs = http_build_query($query);
            $uri .= (strpos($uri, '?') === false ? '?' : '&').$qs;
        }
        return $uri;
    }
protected static function appendQuery(string $uri, array $query = []): string {
        if (!empty($query)) {
            $qs = http_build_query($query);
            $uri .= (strpos($uri, '?') === false ? '?' : '&').$qs;
        }
        return $uri;
    }
protected static function appendQuery ( string $ uri , array $ query = [ ] ) : string { if ( ! empty ( $ query ) ) { $ qs = http_build_query ( $ query ) ; $ uri .= ( strpos ( $ uri , '?' ) === false ? '?' : '&' ) . $ qs ; } return $ uri ; }
Construct and append a querystring array to a uri.

@param string $uri The uri to append the query to.
@param array $query The query to turn into a querystring.
@return string Returns the final uri.
Construct and append a querystring array to a uri .