Browse Source

Fixed special case about reflection introduced by #16528

tags/2.0.16
Alexander Makarov 6 years ago
parent
commit
1f709e7133
No known key found for this signature in database
GPG Key ID: 3617B79C6A325E4A
  1. 2
      framework/di/Container.php

2
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);

Loading…
Cancel
Save