Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
xabbuh committed Jan 7, 2025
2 parents a26584f + 01645cd commit 6ce0699
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DependencyInjection/LoggerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions Tests/DependencyInjection/LoggerPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 6ce0699

Please sign in to comment.