protected function AnnotationClassLoader::addRoute

1 call to AnnotationClassLoader::addRoute()
AnnotationClassLoader::load in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
Loads from annotations from a class.

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Loader/AnnotationClassLoader.php, line 144

Class

AnnotationClassLoader
AnnotationClassLoader loads routing information from a PHP class and its methods.

Namespace

Symfony\Component\Routing\Loader

Code

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);
}