private function PhpMatcherDumper::countDirectChildRoutes

Counts the number of routes as direct child of the RouteCollection.

Parameters

RouteCollection $routes A RouteCollection instance:

Return value

integer Number of Routes

1 call to PhpMatcherDumper::countDirectChildRoutes()
PhpMatcherDumper::compileRoutes in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
Generates PHP code recursively to match a RouteCollection with all child routes and child collections.

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php, line 108

Class

PhpMatcherDumper
PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes.

Namespace

Symfony\Component\Routing\Matcher\Dumper

Code

private function countDirectChildRoutes(RouteCollection $routes) {
  $count = 0;
  foreach ($routes as $route) {
    if ($route instanceof Route) {
      $count++;
    }
  }
  return $count;
}