8000 [Routing] Add createRoute method for AnnotationClassLoader by henrikbjorn · Pull Request #10112 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Add createRoute method for AnnotationClassLoader #10112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add createRoute method for AnnotationClassLoader
This allows to use a custom route class. So if you want to support
annotations for Routing in Silex it can now be done while keeping the
custom routing options Silex supports.
  • Loading branch information
henrikbjorn committed Jan 23, 2014
commit 97404b36143707c1589268d76b1ba8556e4faa57
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl
$condition = $globals['condition'];
}

$route = new Route($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
$route = $this->createRoute($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods, $condition);

$this->configureRoute($route, $class, $method, $annot);

Expand Down Expand Up @@ -259,5 +259,10 @@ protected function getGlobals(\ReflectionClass $class)
return $globals;
}

protected function createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition)
{
return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
}

abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot);
}
0