Skip to content

Commit

Permalink
Adjust pretty name of closures on PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Apr 16, 2024
1 parent 7a69a85 commit 0a6a44a
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 @@ -47,7 +47,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, ?Eve
$this->pretty = $this->name.'::'.$listener[1];
} elseif ($listener instanceof \Closure) {
$r = new \ReflectionFunction($listener);
if (str_contains($r->name, '{closure}')) {
if (str_contains($r->name, '{closure')) {
$this->pretty = $this->name = 'closure';
} elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
$this->name = $class->name;
Expand Down

0 comments on commit 0a6a44a

Please sign in to comment.