Fixed special case about reflection introduced by #16528

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Alexander Makarov
2018-09-08 00:09:51 +03:00
gitea-unlock(16/)
parent 2aa79865ad
commit 1f709e7133

2
framework/di/Container.php
View File

@@ -523,7 +523,7 @@ class Container extends Component
{ {
if (is_array($callback)) { if (is_array($callback)) {
$reflection = new \ReflectionMethod($callback[0], $callback[1]); $reflection = new \ReflectionMethod($callback[0], $callback[1]);
} elseif (is_object($callback)) { } elseif (is_object($callback) && !$callback instanceof \Closure) {
$reflection = new \ReflectionMethod($callback, '__invoke'); $reflection = new \ReflectionMethod($callback, '__invoke');
} else { } else {
$reflection = new \ReflectionFunction($callback); $reflection = new \ReflectionFunction($callback);