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;
    }
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;
    }
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 ; }
Sort routes by their URI pattern.

@param Route[] $routes

@return Route[]
Sort routes by their URI pattern .