From bc19ecc669fa19d8bbf45e0140f8788c1b9f4b07 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 May 2024 08:23:09 +0200 Subject: [PATCH 1/3] Adjust pretty name of closures on PHP 8.4 --- framework/web/ErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/web/ErrorHandler.php b/framework/web/ErrorHandler.php index 13b317c1801..e4dc43a3121 100644 --- a/framework/web/ErrorHandler.php +++ b/framework/web/ErrorHandler.php @@ -204,7 +204,7 @@ public function addTypeLinks($code) $url = null; $shouldGenerateLink = true; - if ($method !== null && substr_compare($method, '{closure}', -9) !== 0) { + if ($method !== null && substr_compare($method, '{closure', -8) !== 0) { $reflection = new \ReflectionClass($class); if ($reflection->hasMethod($method)) { $reflectionMethod = $reflection->getMethod($method); From eda0aa4ac647fabf78cc3a86c6ede16bcc73e74d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 May 2024 08:48:06 +0200 Subject: [PATCH 2/3] fix --- framework/web/ErrorHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/web/ErrorHandler.php b/framework/web/ErrorHandler.php index e4dc43a3121..41843099eaa 100644 --- a/framework/web/ErrorHandler.php +++ b/framework/web/ErrorHandler.php @@ -204,7 +204,7 @@ public function addTypeLinks($code) $url = null; $shouldGenerateLink = true; - if ($method !== null && substr_compare($method, '{closure', -8) !== 0) { + if ($method !== null && strpos($method, '{closure') === false) { $reflection = new \ReflectionClass($class); if ($reflection->hasMethod($method)) { $reflectionMethod = $reflection->getMethod($method); From e835631dcd51417088dbd31993b500fc53351f79 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 27 May 2024 14:34:56 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- framework/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 43c56c52296..48630a5dcc7 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -28,6 +28,7 @@ Yii Framework 2 Change Log - Enh #20134: Raise minimum `PHP` version to `7.3` (@terabytesoftw) - Bug #20141: Update `ezyang/htmlpurifier` dependency to version `4.17` (@terabytesoftw) - Bug #19817: Add MySQL Query `addCheck()` and `dropCheck()` (@bobonov) +- Bug #20165: Adjust pretty name of closures for PHP 8.4 compatibility (@staabm) 2.0.49.2 October 12, 2023 -------------------------