Skip to content

Commit 8d8d3d4

Browse files
minor #33280 fix deprecated call to setLocale with null (Tobion)
This PR was merged into the 4.4 branch. Discussion ---------- fix deprecated call to setLocale with null | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | Fix a potentially invalid call since #33272 Commits ------- 26f9afe fix deprecated call to setLocale with null
2 parents f499083 + 26f9afe commit 8d8d3d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/HttpKernel/EventListener/LocaleAwareListener.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function onKernelRequest(RequestEvent $event): void
4646
public function onKernelFinishRequest(FinishRequestEvent $event): void
4747
{
4848
if (null === $parentRequest = $this->requestStack->getParentRequest()) {
49-
$this->setLocale($event->getRequest()->getDefaultLocale());
49+
foreach ($this->localeAwareServices as $service) {
50+
$service->setLocale($event->getRequest()->getDefaultLocale());
51+
}
5052

5153
return;
5254
}
@@ -63,7 +65,7 @@ public static function getSubscribedEvents()
6365
];
6466
}
6567

66-
private function setLocale(string $locale, string $defaultLocale = null): void
68+
private function setLocale(string $locale, string $defaultLocale): void
6769
{
6870
foreach ($this->localeAwareServices as $service) {
6971
try {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy