mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixed special case about reflection introduced by #16528
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user