aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller/resolver.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/controller/resolver.php')
-rw-r--r--phpBB/phpbb/controller/resolver.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
index 4f432c3323..f8dffc12de 100644
--- a/phpBB/phpbb/controller/resolver.php
+++ b/phpBB/phpbb/controller/resolver.php
@@ -126,9 +126,21 @@ 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();