protected function parseQuery($url, $parameters = [])
{
if ($query = substr(strstr($url, '?'), 1)) {
parse_str($query, $params);
$url = strstr($url, '?', true);
$parameters = array_replace($parameters, $params);
}
if ($query = http_build_query($parameters, '', '&')) {
$url .= '?' . $query;
}
return $url;
}