mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-12 14:55:24 +00:00
Add support for first class callables
This commit is contained in:
@@ -55,8 +55,10 @@ final class ReflectionCallable
|
||||
$callable = [$object, $r->name];
|
||||
$this->name = get_debug_type($object).'::'.$r->name;
|
||||
} elseif (\PHP_VERSION_ID >= 80111 && $class = $r->getClosureCalledClass()) {
|
||||
$callable = [$class->name, $r->name];
|
||||
$this->name = $class->name.'::'.$r->name;
|
||||
} elseif (\PHP_VERSION_ID < 80111 && $class = $r->getClosureScopeClass()) {
|
||||
$callable = [\is_array($callable) ? $callable[0] : $class->name, $r->name];
|
||||
$this->name = (\is_array($callable) ? $callable[0] : $class->name).'::'.$r->name;
|
||||
} else {
|
||||
$callable = $this->name = $r->name;
|
||||
|
||||
Reference in New Issue
Block a user