File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ 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
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
1821 string $locales : ' %app_locales%'
1922 string $defaultLocale : ' %locale%'
2023
@@ -26,3 +29,6 @@ services:
2629 - ' ../src/DependencyInjection/'
2730 - ' ../src/Entity/'
2831 - ' ../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 1616use App \Form \UserType ;
1717use Doctrine \ORM \EntityManagerInterface ;
1818use Symfony \Bundle \FrameworkBundle \Controller \AbstractController ;
19- use Symfony \Component \DependencyInjection \Attribute \Autowire ;
2019use Symfony \Component \HttpFoundation \Request ;
2120use Symfony \Component \HttpFoundation \Response ;
2221use Symfony \Component \Routing \Annotation \Route ;
@@ -63,7 +62,6 @@ public function changePassword(
6362 #[CurrentUser] User $ user ,
6463 Request $ request ,
6564 EntityManagerInterface $ entityManager ,
66- #[Autowire('@security.logout_url_generator ' )]
6765 LogoutUrlGenerator $ logoutUrlGenerator ,
6866 ): Response {
6967 $ form = $ this ->createForm (ChangePasswordType::class, $ user );
You can’t perform that action at this time.
0 commit comments