diff --git a/Attribute/MapQueryParameter.php b/Attribute/MapQueryParameter.php index 5b147b8143..ec9bf57726 100644 --- a/Attribute/MapQueryParameter.php +++ b/Attribute/MapQueryParameter.php @@ -25,7 +25,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 * @param (FILTER_VALIDATE_*)|(FILTER_SANITIZE_*)|null $filter The filter to pass to "filter_var()" diff --git a/DependencyInjection/LoggerPass.php b/DependencyInjection/LoggerPass.php index 2cc75950fd..7566d7358c 100644 --- a/DependencyInjection/LoggerPass.php +++ b/DependencyInjection/LoggerPass.php @@ -27,7 +27,9 @@ class LoggerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { - $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 387b51c8a4..4b6ecb68d8 100644 --- a/Kernel.php +++ b/Kernel.php @@ -73,11 +73,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '7.2.2'; - public const VERSION_ID = 70202; + public const VERSION = '7.2.3'; + public const VERSION_ID = 70203; public const MAJOR_VERSION = 7; public const MINOR_VERSION = 2; - public const RELEASE_VERSION = 2; + public const RELEASE_VERSION = 3; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '07/2025'; 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)); + } }