File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ services:
14
14
_defaults :
15
15
autowire : true # Automatically injects dependencies in your services.
16
16
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
17
+ bind :
18
+ # this allows to define the scalar arguments once and apply them to any services
19
+ # defined/created in this file; if some argument is used rarely, instead of defining
20
+ # it here you can use the #[Autowire] attribute to inject it manually in the service constructor
18
21
string $locales : ' %app_locales%'
19
22
string $defaultLocale : ' %locale%'
20
23
@@ -26,3 +29,6 @@ services:
26
29
- ' ../src/DependencyInjection/'
27
30
- ' ../src/Entity/'
28
31
- ' ../src/Kernel.php'
32
+
33
+ # this is needed because Symfony doesn't make the 'security.logout_url_generator' service autowirable
34
+ Symfony\Component\Security\Http\Logout\LogoutUrlGenerator : ' @security.logout_url_generator'
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 ;
20
19
use Symfony \Component \HttpFoundation \Request ;
21
20
use Symfony \Component \HttpFoundation \Response ;
22
21
use Symfony \Component \Routing \Annotation \Route ;
@@ -63,7 +62,6 @@ public function changePassword(
63
62
#[CurrentUser] User $ user ,
64
63
Request $ request ,
65
64
EntityManagerInterface $ entityManager ,
66
- #[Autowire('@security.logout_url_generator ' )]
67
65
LogoutUrlGenerator $ logoutUrlGenerator ,
68
66
): Response {
69
67
$ form = $ this ->createForm (ChangePasswordType::class, $ user );
You can’t perform that action at this time.
0 commit comments