Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 97404b3

Browse filesBrowse files
committed
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.
1 parent 4ad343b commit 97404b3
Copy full SHA for 97404b3

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function addRoute(RouteCollection $collection, $annot, $globals, \Refl
158158
$condition = $globals['condition'];
159159
}
160160

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

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

@@ -259,5 +259,10 @@ protected function getGlobals(\ReflectionClass $class)
259259
return $globals;
260260
}
261261

262+
protected function createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition)
263+
{
264+
return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
265+
}
266+
262267
abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot);
263268
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.