diff --git a/Attribute/MapQueryParameter.php b/Attribute/MapQueryParameter.php index f83e331e41..bbc1fff273 100644 --- a/Attribute/MapQueryParameter.php +++ b/Attribute/MapQueryParameter.php @@ -22,7 +22,7 @@ final class MapQueryParameter extends ValueResolver { /** - * @see https://php.net/filter.filters.validate for filter, flags and options + * @see https://php.net/manual/filter.constants for filter, flags and options * * @param string|null $name The name of the query parameter. If null, the name of the argument in the controller will be used. */ 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/Kernel.php b/Kernel.php index eb98942076..e2a01a4ac0 100644 --- a/Kernel.php +++ b/Kernel.php @@ -76,11 +76,11 @@ 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'; + public const VERSION_ID = 60418; public const MAJOR_VERSION = 6; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 17; + public const RELEASE_VERSION = 18; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2026'; 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)); + } }