diff options
Diffstat (limited to 'phpBB/phpbb/controller')
-rw-r--r-- | phpBB/phpbb/controller/resolver.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index 4f432c3323..233e2e94a4 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -126,9 +126,18 @@ class resolver implements ControllerResolverInterface */ public function getArguments(Request $request, $controller) { - // At this point, $controller contains the object and method name - list($object, $method) = $controller; - $mirror = new \ReflectionMethod($object, $method); + // At this point, $controller should be a callable + if (is_array($controller)) + { + list($object, $method) = $controller; + $mirror = new \ReflectionMethod($object, $method); + } else if (is_object($controller) && !$controller instanceof \Closure) + { + $mirror = new \ReflectionObject($controller); + $mirror = $mirror->getMethod('__invoke'); + } else { + $mirror = new \ReflectionFunction($controller); + } $arguments = array(); $parameters = $mirror->getParameters(); |