Symfony\Component\Routing\Loader\AnnotationClassLoader::addRoute PHP Method

addRoute() protected method

protected addRoute ( RouteCollection $collection, $annot, $globals, ReflectionClass $class, ReflectionMethod $method )
$collection Symfony\Component\Routing\RouteCollection
$class ReflectionClass
$method ReflectionMethod
    protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method)
    {
        if (null === $annot->getName()) {
            $annot->setName($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($annot->getName(), $route);
    }