You are here

protected function ChainRouter::sortRouters in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/ChainRouter.php \Symfony\Cmf\Component\Routing\ChainRouter::sortRouters()

Sort routers by priority. The highest priority number is the highest priority (reverse sorting)

Return value

RouterInterface[]

1 call to ChainRouter::sortRouters()
ChainRouter::all in vendor/symfony-cmf/routing/ChainRouter.php
Sorts the routers and flattens them.

File

vendor/symfony-cmf/routing/ChainRouter.php, line 124

Class

ChainRouter
The ChainRouter allows to combine several routers to try in a defined order.

Namespace

Symfony\Cmf\Component\Routing

Code

protected function sortRouters() {
  $sortedRouters = array();
  krsort($this->routers);
  foreach ($this->routers as $routers) {
    $sortedRouters = array_merge($sortedRouters, $routers);
  }
  return $sortedRouters;
}