Skip to content

Commit

Permalink
Set controller without __invoke method from invokable class
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Feb 22, 2018
1 parent 952786a commit cc68c50
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ class AnnotatedRouteControllerLoader extends AnnotationClassLoader
*/
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
if ('__invoke' === $method->getName()) {
$route->setDefault('_controller', $class->getName());
} else {
$route->setDefault('_controller', $class->getName().'::'.$method->getName());
}
}

/**
Expand Down

0 comments on commit cc68c50

Please sign in to comment.