public static function buildQueryString(array $parameters) : string
    {
        $queryStrings = [];
        foreach ($parameters as $parameterName => $parameterValue) {
            $parameterName = rawurlencode($parameterName);

            if (is_array($parameterValue)) {
                foreach ($parameterValue as $eachValue) {
                    $eachValue = rawurlencode($eachValue);
                    $queryStrings[] = "{$parameterName}={$eachValue}";
                }
            } elseif ($parameterValue === false) {
                $queryStrings[] = "{$parameterName}=false";
            } elseif ($parameterValue === true) {
                $queryStrings[] = "{$parameterName}=true";
            } else {
                $parameterValue = rawurlencode($parameterValue);
                $queryStrings[] = "{$parameterName}={$parameterValue}";
            }
        }

        return implode('&', $queryStrings);
    }