protected function buildUrl(array $arguments)
    {
        $url = strtr($this->builders['pattern'], $this->buildUrlRequirements($arguments));
        $url = str_replace('//', '/', $url);

        $query = array_filter($arguments);
        if (!empty($query)) {
            $url .= '?' . http_build_query($query, null, '&');
        }

        $url = ltrim($url, './');

        return $url;
    }