File tree 4 files changed +6
-8
lines changed
4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ services:
17
17
bind : # defines the scalar arguments once and apply them to any service defined/created in this file
18
18
string $locales : ' %app_locales%'
19
19
string $defaultLocale : ' %locale%'
20
- string $emailSender : ' %app.notifications.email_sender%'
21
20
22
21
# makes classes in src/ available to be used as services
23
22
# this creates a service per class whose id is the fully-qualified class name
@@ -27,10 +26,3 @@ services:
27
26
- ' ../src/DependencyInjection/'
28
27
- ' ../src/Entity/'
29
28
- ' ../src/Kernel.php'
30
-
31
- # when the service definition only contains arguments, you can omit the
32
- # 'arguments' key and define the arguments just below the service class
33
- App\EventSubscriber\CommentNotificationSubscriber :
34
- $sender : ' %app.notifications.email_sender%'
35
-
36
- Symfony\Component\Security\Http\Logout\LogoutUrlGenerator : ' @security.logout_url_generator'
Original file line number Diff line number Diff line change 20
20
use Symfony \Component \Console \Output \BufferedOutput ;
21
21
use Symfony \Component \Console \Output \OutputInterface ;
22
22
use Symfony \Component \Console \Style \SymfonyStyle ;
23
+ use Symfony \Component \DependencyInjection \Attribute \Autowire ;
23
24
use Symfony \Component \Mailer \MailerInterface ;
24
25
use Symfony \Component \Mime \Email ;
25
26
@@ -47,6 +48,7 @@ final class ListUsersCommand extends Command
47
48
{
48
49
public function __construct (
49
50
private readonly MailerInterface $ mailer ,
51
+ #[Autowire('%app.notifications.email_sender% ' )]
50
52
private readonly string $ emailSender ,
51
53
private readonly UserRepository $ users
52
54
) {
Original file line number Diff line number Diff line change 16
16
use App \Form \UserType ;
17
17
use Doctrine \ORM \EntityManagerInterface ;
18
18
use Symfony \Bundle \FrameworkBundle \Controller \AbstractController ;
19
+ use Symfony \Component \DependencyInjection \Attribute \Autowire ;
19
20
use Symfony \Component \HttpFoundation \Request ;
20
21
use Symfony \Component \HttpFoundation \Response ;
21
22
use Symfony \Component \Routing \Annotation \Route ;
@@ -62,6 +63,7 @@ public function changePassword(
62
63
#[CurrentUser] User $ user ,
63
64
Request $ request ,
64
65
EntityManagerInterface $ entityManager ,
66
+ #[Autowire('@security.logout_url_generator ' )]
65
67
LogoutUrlGenerator $ logoutUrlGenerator ,
66
68
): Response {
67
69
$ form = $ this ->createForm (ChangePasswordType::class, $ user );
Original file line number Diff line number Diff line change 14
14
use App \Entity \Post ;
15
15
use App \Entity \User ;
16
16
use App \Event \CommentCreatedEvent ;
17
+ use Symfony \Component \DependencyInjection \Attribute \Autowire ;
17
18
use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
18
19
use Symfony \Component \Mailer \MailerInterface ;
19
20
use Symfony \Component \Mime \Email ;
@@ -31,6 +32,7 @@ public function __construct(
31
32
private readonly MailerInterface $ mailer ,
32
33
private readonly UrlGeneratorInterface $ urlGenerator ,
33
34
private readonly TranslatorInterface $ translator ,
35
+ #[Autowire('%app.notifications.email_sender% ' )]
34
36
private readonly string $ sender
35
37
) {
36
38
}
You can’t perform that action at this time.
0 commit comments