diff --git a/phpBB/composer.json b/phpBB/composer.json index b402534c13..64657daab5 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -43,8 +43,8 @@ "s9e/text-formatter": "^2.0", "symfony/config": "^6.3", "symfony/console": "^6.3", - "symfony/debug": "~4.4", "symfony/dependency-injection": "^6.3", + "symfony/error-handler": "^6.3", "symfony/event-dispatcher": "^6.3", "symfony/filesystem": "^6.3", "symfony/finder": "^6.3", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 675f5d42d7..73b27c5c52 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "845ee61ff0e24697c187704eecc6a51f", + "content-hash": "0c305d521f2db3eec61dcef5b8359047", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -2847,75 +2847,6 @@ ], "time": "2023-08-16T10:10:12+00:00" }, - { - "name": "symfony/debug", - "version": "v4.4.44", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to ease debugging PHP code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.44" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "abandoned": "symfony/error-handler", - "time": "2022-07-28T16:29:46+00:00" - }, { "name": "symfony/dependency-injection", "version": "v6.3.4", diff --git a/phpBB/phpbb/debug/debug.php b/phpBB/phpbb/debug/debug.php index c5ffada2e5..eacb28c25c 100644 --- a/phpBB/phpbb/debug/debug.php +++ b/phpBB/phpbb/debug/debug.php @@ -13,14 +13,13 @@ namespace phpbb\debug; -use Symfony\Component\Debug\BufferingLogger; -use Symfony\Component\Debug\DebugClassLoader; -use Symfony\Component\Debug\ExceptionHandler; +use Symfony\Component\ErrorHandler\BufferingLogger; +use Symfony\Component\ErrorHandler\ErrorHandler; /** * Registers all the debug tools. - * @see Symfony\Component\Debug\Debug + * @see \Symfony\Component\ErrorHandler\Debug */ class debug { @@ -34,10 +33,10 @@ class debug * If the Symfony ClassLoader component is available, a special * class loader is also registered. * - * @param int $errorReportingLevel The level of error reporting you want - * @param bool $displayErrors Whether to display errors (for development) or just log them (for production) + * @param int|null $errorReportingLevel The level of error reporting you want + * @param bool $displayErrors Whether to display errors (for development) or just log them (for production) */ - public static function enable($errorReportingLevel = null, $displayErrors = true) + public static function enable(?int $errorReportingLevel = null, bool $displayErrors = true): void { if (static::$enabled) { @@ -58,7 +57,7 @@ class debug if ('cli' !== php_sapi_name()) { ini_set('display_errors', 0); - ExceptionHandler::register(); + ErrorHandler::register(); } else if ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { @@ -75,6 +74,6 @@ class debug error_handler::register()->throwAt(0, true); } - DebugClassLoader::enable(); + Debug::enable(); } } diff --git a/phpBB/phpbb/debug/error_handler.php b/phpBB/phpbb/debug/error_handler.php index f2b00e6365..2356045b4d 100644 --- a/phpBB/phpbb/debug/error_handler.php +++ b/phpBB/phpbb/debug/error_handler.php @@ -13,7 +13,7 @@ namespace phpbb\debug; -use Symfony\Component\Debug\ErrorHandler; +use Symfony\Component\ErrorHandler\ErrorHandler; /** * @psalm-suppress InvalidExtendClass @@ -23,7 +23,7 @@ class error_handler extends ErrorHandler /** * @psalm-suppress MethodSignatureMismatch */ - public function handleError($type, $message, $file, $line) + public function handleError(int $type, string $message, string $file, int $line): bool { if ($type === E_USER_WARNING || $type === E_USER_NOTICE) {