From 8ae6fa1205897dcfc57867542c94874cc4fca8bd Mon Sep 17 00:00:00 2001 From: Juliette <663378+jrfnl@users.noreply.github.com> Date: Thu, 19 Sep 2024 09:34:35 +0200 Subject: [PATCH] PHP 8.4 | Remove use of `E_STRICT` (#12116) The `E_STRICT` constant is deprecated as of PHP 8.4 and will be removed in PHP 9.0 (commit finally went in today). The error level hasn't been in use since PHP 8.0 anyway and was only barely still used in PHP 7.x, so removing the exclusion from the `error_reporting()` setting in these script shouldn't really make any difference in practice. Ref: * https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant Co-authored-by: jrfnl --- src/Composer/Util/ErrorHandler.php | 2 +- src/Composer/Util/Silencer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php index fbd92843d..d06b57718 100644 --- a/src/Composer/Util/ErrorHandler.php +++ b/src/Composer/Util/ErrorHandler.php @@ -78,7 +78,7 @@ class ErrorHandler public static function register(?IOInterface $io = null): void { set_error_handler([__CLASS__, 'handle']); - error_reporting(E_ALL | E_STRICT); + error_reporting(E_ALL); self::$io = $io; } } diff --git a/src/Composer/Util/Silencer.php b/src/Composer/Util/Silencer.php index f2b9f73fc..6dd0efb34 100644 --- a/src/Composer/Util/Silencer.php +++ b/src/Composer/Util/Silencer.php @@ -33,7 +33,7 @@ class Silencer public static function suppress(?int $mask = null): int { if (!isset($mask)) { - $mask = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT; + $mask = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED; } $old = error_reporting(); self::$stack[] = $old;