Skip to content

Commit 6d1c1b8

Browse files
Merge branch '6.1' into 6.2
* 6.1: [HttpFoundation] IPv4-mapped IPv6 addresses incorrectly rejected Minor (comment only), part 2 [RateLimiter] Add typecast to Reservation::wait [FrameworkBundle] add `kernel.locale_aware` tag to `LocaleSwitcher` [FrameworkBundle] Remove check of undefined service in mailer assertions [VarDumper] Ignore \Error in __debugInfo()
2 parents af71efe + c1c2b22 commit 6d1c1b8

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Resources/config/translation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,11 @@
186186
->set('translation.locale_switcher', LocaleSwitcher::class)
187187
->args([
188188
param('kernel.default_locale'),
189-
tagged_iterator('kernel.locale_aware'),
189+
tagged_iterator('kernel.locale_aware', exclude: 'translation.locale_switcher'),
190190
service('router.request_context')->ignoreOnInvalid(),
191191
])
192192
->tag('kernel.reset', ['method' => 'reset'])
193+
->tag('kernel.locale_aware')
193194
->alias(LocaleAwareInterface::class, 'translation.locale_switcher')
194195
->alias(LocaleSwitcher::class, 'translation.locale_switcher')
195196
;

Test/MailerAssertionsTrait.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ private static function getMessageMailerEvents(): MessageEvents
123123
return $container->get('mailer.message_logger_listener')->getEvents();
124124
}
125125

126-
if ($container->has('mailer.logger_message_listener')) {
127-
return $container->get('mailer.logger_message_listener')->getEvents();
128-
}
129-
130126
static::fail('A client must have Mailer enabled to make email assertions. Did you forget to require symfony/mailer?');
131127
}
132128
}

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Symfony\Component\DependencyInjection\ChildDefinition;
3838
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
3939
use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
40+
use Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass;
4041
use Symfony\Component\DependencyInjection\ContainerBuilder;
4142
use Symfony\Component\DependencyInjection\ContainerInterface;
4243
use Symfony\Component\DependencyInjection\Definition;
@@ -2067,7 +2068,9 @@ public function testLocaleSwitcherServiceRegistered()
20672068
$this->markTestSkipped('LocaleSwitcher not available.');
20682069
}
20692070

2070-
$container = $this->createContainerFromFile('full');
2071+
$container = $this->createContainerFromFile('full', compile: false);
2072+
$container->addCompilerPass(new ResolveTaggedIteratorArgumentPass());
2073+
$container->compile();
20712074

20722075
$this->assertTrue($container->has('translation.locale_switcher'));
20732076

@@ -2077,6 +2080,10 @@ public function testLocaleSwitcherServiceRegistered()
20772080
$this->assertInstanceOf(TaggedIteratorArgument::class, $switcherDef->getArgument(1));
20782081
$this->assertSame('kernel.locale_aware', $switcherDef->getArgument(1)->getTag());
20792082
$this->assertEquals(new Reference('router.request_context', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $switcherDef->getArgument(2));
2083+
2084+
$localeAwareServices = array_map(fn (Reference $r) => (string) $r, $switcherDef->getArgument(1)->getValues());
2085+
2086+
$this->assertNotContains('translation.locale_switcher', $localeAwareServices);
20802087
}
20812088

20822089
public function testHtmlSanitizer()

0 commit comments

Comments
 (0)