From 0a6a44ad26b3407e6aff90106f52cafd503b29ea Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 16 Apr 2024 10:45:54 +0200 Subject: [PATCH] Adjust pretty name of closures on PHP 8.4 --- Debug/WrappedListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Debug/WrappedListener.php b/Debug/WrappedListener.php index 80d49a1..792c175 100644 --- a/Debug/WrappedListener.php +++ b/Debug/WrappedListener.php @@ -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;