From cbe48081f512fb823727d8aaf4ea35507a9d3c67 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 30 May 2023 10:36:39 +0200 Subject: [PATCH] [FrameworkBundle][PhpUnitBridge] Configure doctrine/deprecations as expected --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php | 5 +++++ src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index f28933cf97357..50f62b9abcfef 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -151,6 +151,11 @@ putenv('SYMFONY_DEPRECATIONS_HELPER=disabled'); } +if (!$getEnvVar('DOCTRINE_DEPRECATIONS')) { + putenv('DOCTRINE_DEPRECATIONS=trigger'); + $_SERVER['DOCTRINE_DEPRECATIONS'] = $_ENV['DOCTRINE_DEPRECATIONS'] = 'trigger'; +} + $COMPOSER = ($COMPOSER = getenv('COMPOSER_BINARY')) || file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rtrim((string) ('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', shell_exec('where.exe composer.phar 2> NUL')) : shell_exec('which composer.phar 2> /dev/null')))) diff --git a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php index ffb96a23e5f5b..36e5cd4028010 100644 --- a/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php @@ -95,6 +95,8 @@ class FrameworkBundle extends Bundle */ public function boot() { + $_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger'; + $handler = ErrorHandler::register(null, false); $this->container->get('debug.error_handler_configurator')->configure($handler);