private function sortPattern(array $routes)
    {
        uasort($routes, function (Route $a, Route $b) {
            if ($a->getPath() === $b->getPath()) {
                return 0;
            }
            $a = str_replace('{', '', str_replace('}', '', $a->getPath()));
            $b = str_replace('{', '', str_replace('}', '', $b->getPath()));

            return ($a < $b) ? -1 : 1;
        });

        return $routes;
    }