From 0f60608de9c0d06520b44e70b7117ac01f08b115 Mon Sep 17 00:00:00 2001 From: Marijus Kilmanas Date: Wed, 20 Dec 2023 20:14:00 +0200 Subject: [PATCH] Do not redeclare controller container property in order to avoid compatibility issues (#179) ### Changes Please describe both what is changing and why this is important. Include: - Removing scope keyword from constructor parameter to avoid property re-declaration - In turn that allows compatibility with both symfony version 6.x and 7.x - Using given setter to achieve the same desired result ### References [#178] ### Testing Previously Symfony (6.4) app container building (cache:clear) was throwing a fatal error, now it's not. - [ ] This change adds test coverage - [x] This change has been tested on the latest version of Symfony ### Checklist - [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md) - [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md) - [ ] All existing and new tests complete without errors --- src/Controllers/AuthenticationController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controllers/AuthenticationController.php b/src/Controllers/AuthenticationController.php index e8b85ce..0ec6504 100644 --- a/src/Controllers/AuthenticationController.php +++ b/src/Controllers/AuthenticationController.php @@ -22,8 +22,9 @@ final class AuthenticationController extends AbstractController implements Authe public function __construct( private Authenticator $authenticator, private RouterInterface $router, - protected ContainerInterface $container, + ContainerInterface $container, ) { + $this-setContainer($container); } /**