return $collection;
} foreach ($class->
getMethods() as $method) { $this->defaultRouteIndex = 0;
foreach ($this->
getAnnotations($method) as $annot) { $this->
addRoute($collection,
$annot,
$globals,
$class,
$method);
} } if (0 ===
$collection->
count() &&
$class->
hasMethod('__invoke'
)) { $globals =
$this->
resetGlobals();
foreach ($this->
getAnnotations($class) as $annot) { $this->
addRoute($collection,
$annot,
$globals,
$class,
$class->
getMethod('__invoke'
));
} } return $collection;
} /**
* @param RouteAnnotation $annot or an object that exposes a similar interface
*
* @return void
*/