Skip to content

Commit 6ce0699

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: (23 commits) add translations for the Slug constraint [Messenger] Fix `TransportMessageIdStamp` not always added [DoctrineBridge] Fix compatibility to Doctrine persistence 2.5 in Doctrine Bridge 6.4 to avoid Projects stuck on 6.3 [PropertyInfo] Fix add missing composer conflict [ErrorHandler] Don't trigger "internal" deprecations for anonymous LazyClosure instances [VarDumper] Fix displaying closure's "this" from anonymous classes [Doctrine][Messenger] Prevents multiple TransportMessageIdStamp being stored in envelope [HttpKernel] Don't override existing LoggerInterface autowiring alias in LoggerPass reject inline notations followed by invalid content [Security] Fix triggering session tracking from ContextListener [AssetMapper] add leading slash to public prefix fix: modify Exception message parameter order [Yaml] Fix parsing of unquoted strings in Parser::lexUnquotedString() to ignore spaces Update exception.css Bump Symfony version to 6.4.18 Update VERSION for 6.4.17 Update CONTRIBUTORS for 6.4.17 Update CHANGELOG for 6.4.17 Fix exception thrown by YamlEncoder [AssetMapper] Fix JavaScript compiler create self-referencing imports ...
2 parents a26584f + 01645cd commit 6ce0699

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

DependencyInjection/LoggerPass.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class LoggerPass implements CompilerPassInterface
2727
{
2828
public function process(ContainerBuilder $container): void
2929
{
30-
$container->setAlias(LoggerInterface::class, 'logger');
30+
if (!$container->has(LoggerInterface::class)) {
31+
$container->setAlias(LoggerInterface::class, 'logger');
32+
}
3133

3234
if ($container->has('logger')) {
3335
return;

Tests/DependencyInjection/LoggerPassTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,15 @@ public function testRegisterLogger()
5353
$this->assertSame(Logger::class, $definition->getClass());
5454
$this->assertFalse($definition->isPublic());
5555
}
56+
57+
public function testAutowiringAliasIsPreserved()
58+
{
59+
$container = new ContainerBuilder();
60+
$container->setParameter('kernel.debug', false);
61+
$container->setAlias(LoggerInterface::class, 'my_logger');
62+
63+
(new LoggerPass())->process($container);
64+
65+
$this->assertSame('my_logger', (string) $container->getAlias(LoggerInterface::class));
66+
}
5667
}

0 commit comments

Comments
 (0)