Skip to content

Commit c028cb0

Browse files
committed
Revert autowire config for some generic variables
1 parent 00ce9fb commit c028cb0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

config/services.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ services:
1414
_defaults:
1515
autowire: true # Automatically injects dependencies in your services.
1616
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
17+
bind: # defines the scalar arguments once and apply them to any service defined/created in this file
18+
string $locales: '%app_locales%'
19+
string $defaultLocale: '%locale%'
1720

1821
# makes classes in src/ available to be used as services
1922
# this creates a service per class whose id is the fully-qualified class name

src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ final class RedirectToPreferredLocaleSubscriber implements EventSubscriberInterf
3737

3838
public function __construct(
3939
private readonly UrlGeneratorInterface $urlGenerator,
40-
#[Autowire('%app_locales%')]
4140
string $locales,
42-
#[Autowire('%locale%')]
4341
string $defaultLocale = null
4442
) {
4543
$this->locales = explode('|', trim($locales));

0 commit comments

Comments
 (0)