Counts the number of routes as direct child of the RouteCollection.
RouteCollection $routes A RouteCollection instance:
integer Number of Routes
private function countDirectChildRoutes(RouteCollection $routes) {
$count = 0;
foreach ($routes as $route) {
if ($route instanceof Route) {
$count++;
}
}
return $count;
}