8000 fix method · tegos/laravel-framework@e511a3b · GitHub
[go: up one dir, main page]

Skip to content

Commit e511a3b

Browse files
committed
fix method
1 parent de8d515 commit e511a3b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Illuminate/Container/Container.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,20 @@ public function call($callback, array $parameters = [], $defaultMethod = null)
676676
*/
677677
protected function getClassForCallable($callback)
678678
{
679-
if (is_callable($callback) &&
680-
! ($reflector = new ReflectionFunction($callback(...)))->isAnonymous()) {
681-
return $reflector->getClosureScopeClass()->name ?? false;
679+
if (PHP_VERSION_ID >= 80200) {
680+
if (is_callable($callback) &&
681+
! ($reflector = new ReflectionFunction($callback(...)))->isAnonymous()) {
682+
return $reflector->getClosureScopeClass()->name ?? false;
683+
}
684+
685+
return false;
686+
}
687+
688+
if (! is_array($callback)) {
689+
return false;
682690
}
683691

684-
return false;
692+
return is_string($callback[0]) ? $callback[0] : get_class($callback[0]);
685693
}
686694

687695
/**

0 commit comments

Comments
 (0)
0