foreach ($collection as $routeKey =>
$r) { $routes[$routeKey] =
$r['handler'
];
} } // sorting routes by priority
if ($this->prioritizeDetected &&
$this->prioritize &&
$routes !==
[]) { $order =
[];
foreach ($routes as $key =>
$value) { $key =
$key === '/' ?
$key :
ltrim($key, '/ '
);
$priority =
$this->
getRoutesOptions($key,
$verb)['priority'
] ?? 0;
$order[$priority][$key] =
$value;
} ksort($order);
$routes =
array_merge(...
$order);
} return $routes;
} /**
* Returns one or all routes options
*
* @return array<string, int|string> [key => value]
*/