src/Routing/RouteCollection.php
/**
     * Order routes by priority number.
     *
     * @return RouteCollection
     */
Order routes by priority number.
Order routes by priority number .
public function buildRoutesOrder()
    {
        $comparePriority = function ($r1, $r2) {
            $a = $this->getRoutePriority($r1);
            $b = $this->getRoutePriority($r2);
            if ($a == $b) {
                return 0;
            }
            return ($a < $b) ? 1 : -1;
        };
        uasort($this->allRoutes, $comparePriority);
        foreach (array_keys($this->routes) as $method) {
            uasort($this->routes[$method], $comparePriority);
        }
        return $this;
    }
public function buildRoutesOrder ( ) { $ comparePriority = function ( $ r1 , $ r2 ) { $ a = $ this -> getRoutePriority ( $ r1 ) ; $ b = $ this -> getRoutePriority ( $ r2 ) ; if ( $ a == $ b ) { return 0 ; } return ( $ a < $ b ) ? 1 : - 1 ; } ; uasort ( $ this -> allRoutes , $ comparePriority ) ; foreach ( array_keys ( $ this -> routes ) as $ method ) { uasort ( $ this -> routes [ $ method ] , $ comparePriority ) ; } return $ this ; }
Order routes by priority number.
Order routes by priority number .