protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) {
$name = $annot
->getName();
if (null === $name) {
$name = $this
->getDefaultRouteName($class, $method);
}
$defaults = array_merge($globals['defaults'], $annot
->getDefaults());
$requirements = array_merge($globals['requirements'], $annot
->getRequirements());
$options = array_merge($globals['options'], $annot
->getOptions());
$route = new Route($globals['pattern'] . $annot
->getPattern(), $defaults, $requirements, $options);
$this
->configureRoute($route, $class, $method, $annot);
$collection
->add($name, $route);
}