From 1f709e71336dda51a13f2c9f26f4361d515b0c00 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 8 Sep 2018 00:09:51 +0300 Subject: [PATCH] Fixed special case about reflection introduced by #16528 --- framework/di/Container.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/di/Container.php b/framework/di/Container.php index 4a31a34540..34c804373c 100644 --- a/framework/di/Container.php +++ b/framework/di/Container.php @@ -523,7 +523,7 @@ class Container extends Component { if (is_array($callback)) { $reflection = new \ReflectionMethod($callback[0], $callback[1]); - } elseif (is_object($callback)) { + } elseif (is_object($callback) && !$callback instanceof \Closure) { $reflection = new \ReflectionMethod($callback, '__invoke'); } else { $reflection = new \ReflectionFunction($callback);