8000 Set controller without __invoke method from invokable class · symfony/symfony@cc68c50 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc68c50

Browse files
committed
Set controller without __invoke method from invokable class
1 parent 952786a commit cc68c50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ class AnnotatedRouteControllerLoader extends AnnotationClassLoader
2929
*/
3030
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
3131
{
32-
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
32+
if ('__invoke' === $method->getName()) {
33+
$route->setDefault('_controller', $class->getName());
34+
} else {
35+
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
36+
}
3337
}
3438

3539
/**

0 commit comments

Comments
 (0)
0