Skip to content

Commit bf229ce

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

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace App\EventSubscriber;
1313

14-
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1514
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1615
use Symfony\Component\HttpFoundation\RedirectResponse;
1716
use Symfony\Component\HttpKernel\Event\RequestEvent;
@@ -37,9 +36,7 @@ final class RedirectToPreferredLocaleSubscriber implements EventSubscriberInterf
3736

3837
public function __construct(
3938
private readonly UrlGeneratorInterface $urlGenerator,
40-
#[Autowire('%app_locales%')]
4139
string $locales,
42-
#[Autowire('%locale%')]
4340
string $defaultLocale = null
4441
) {
4542
$this->locales = explode('|', trim($locales));

0 commit comments

Comments
 (0)