From c5647393c5ce11833d13e4b70fff4b571d4ac710 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 31 Dec 2024 15:49:31 +0100 Subject: [PATCH 1/3] Update VERSION for 6.4.17 --- Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel.php b/Kernel.php index 185c9686aa..eb98942076 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.4.17-DEV'; + public const VERSION = '6.4.17'; public const VERSION_ID = 60417; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2026'; public const END_OF_LIFE = '11/2027'; From 8819bee6fc49e63057e3df15e08040f01306fc92 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 31 Dec 2024 15:55:00 +0100 Subject: [PATCH 2/3] Bump Symfony version to 6.4.18 --- Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel.php b/Kernel.php index eb98942076..7e357fa528 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '6.4.17'; - public const VERSION_ID = 60417; + public const VERSION = '6.4.18-DEV'; + public const VERSION_ID = 60418; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 17; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = 18; + public const EXTRA_VERSION = 'DEV'; public const END_OF_MAINTENANCE = '11/2026'; public const END_OF_LIFE = '11/2027'; From 01645cdebe349724030aadcedeeeb4dd9ad4827a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 3 Jan 2025 18:18:56 +0100 Subject: [PATCH 3/3] [HttpKernel] Don't override existing LoggerInterface autowiring alias in LoggerPass --- DependencyInjection/LoggerPass.php | 4 +++- Tests/DependencyInjection/LoggerPassTest.php | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/LoggerPass.php b/DependencyInjection/LoggerPass.php index 6270875bec..0061a577c7 100644 --- a/DependencyInjection/LoggerPass.php +++ b/DependencyInjection/LoggerPass.php @@ -30,7 +30,9 @@ class LoggerPass implements CompilerPassInterface */ public function process(ContainerBuilder $container) { - $container->setAlias(LoggerInterface::class, 'logger'); + if (!$container->has(LoggerInterface::class)) { + $container->setAlias(LoggerInterface::class, 'logger'); + } if ($container->has('logger')) { return; diff --git a/Tests/DependencyInjection/LoggerPassTest.php b/Tests/DependencyInjection/LoggerPassTest.php index cb504877cd..33227e49cb 100644 --- a/Tests/DependencyInjection/LoggerPassTest.php +++ b/Tests/DependencyInjection/LoggerPassTest.php @@ -53,4 +53,15 @@ public function testRegisterLogger() $this->assertSame(Logger::class, $definition->getClass()); $this->assertFalse($definition->isPublic()); } + + public function testAutowiringAliasIsPreserved() + { + $container = new ContainerBuilder(); + $container->setParameter('kernel.debug', false); + $container->setAlias(LoggerInterface::class, 'my_logger'); + + (new LoggerPass())->process($container); + + $this->assertSame('my_logger', (string) $container->getAlias(LoggerInterface::class)); + } }