DmitryDulepov\Realurl\EncodeDecoderBase::getSortedUrl PHP Method

getSortedUrl() protected method

Obtains URL with all query parameters sorted.
protected getSortedUrl ( string $url ) : string
$url string
return string
    protected function getSortedUrl($url)
    {
        $urlParts = parse_url($url);
        $sortedUrl = $urlParts['path'];
        if ($urlParts['query']) {
            parse_str($url, $parameters);
            $this->sortArrayDeep($parameters);
            $sortedUrl .= '?' . $this->createQueryStringFromParameters($parameters);
        }
        return $sortedUrl;
    }