Skip to content

Commit

Permalink
Fix getting the name of closures on PHP 8.1.11+
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Dec 12, 2022
1 parent 8e6ce1c commit 8e18a9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Debug/WrappedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even
$r = new \ReflectionFunction($listener);
if (str_contains($r->name, '{closure}')) {
$this->pretty = $this->name = 'closure';
} elseif ($class = $r->getClosureScopeClass()) {
} elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
$this->name = $class->name;
$this->pretty = $this->name.'::'.$r->name;
} else {
Expand Down

0 comments on commit 8e18a9d

Please sign in to comment.