public function RouteCollection::count

Gets the number of Routes in this collection.

Return value

int The number of routes in this collection, including nested collections

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php, line 96

Class

RouteCollection
A RouteCollection represents a set of Route instances as a tree structure.

Namespace

Symfony\Component\Routing

Code

public function count() {
  $count = 0;
  foreach ($this->routes as $route) {
    $count += $route instanceof RouteCollection ? count($route) : 1;
  }
  return $count;
}