From 2582b4d1368216cf6269db3cd1b22eeef07453d9 Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Tue, 7 Dec 2021 08:38:39 +0100 Subject: [PATCH 1/3] Bugfix | Prevent fatal error on Symfony 5.4 in `HWIOAuthExtension` --- DependencyInjection/HWIOAuthExtension.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/DependencyInjection/HWIOAuthExtension.php b/DependencyInjection/HWIOAuthExtension.php index c960f104d..390bb8999 100644 --- a/DependencyInjection/HWIOAuthExtension.php +++ b/DependencyInjection/HWIOAuthExtension.php @@ -142,10 +142,7 @@ public function createResourceOwnerService(ContainerBuilder $container, $name, a $container->setDefinition('hwi_oauth.resource_owner.'.$name, $definition); } - /** - * @return string - */ - public function getAlias() + public function getAlias(): string { return 'hwi_oauth'; } From cc21052e5514114d63b80e300b84bf8d008ff25e Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Tue, 7 Dec 2021 08:40:37 +0100 Subject: [PATCH 2/3] Bugfix | Remove false PHPStan ignore in `AbstractOAuthToken` --- Security/Core/Authentication/Token/AbstractOAuthToken.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Security/Core/Authentication/Token/AbstractOAuthToken.php b/Security/Core/Authentication/Token/AbstractOAuthToken.php index b5512d781..e2d270d9b 100644 --- a/Security/Core/Authentication/Token/AbstractOAuthToken.php +++ b/Security/Core/Authentication/Token/AbstractOAuthToken.php @@ -70,10 +70,9 @@ public function __construct($accessToken, array $roles = []) // Workaround for: Method "AbstractToken::setAuthenticated()" is deprecated if (Kernel::VERSION_ID > 50399) { - // @phpstan-ignore-next-line - parent::setAuthenticated(\count($roles) > 0, false); + $this->setAuthenticated(\count($roles) > 0, false); } else { - parent::setAuthenticated(\count($roles) > 0); + $this->setAuthenticated(\count($roles) > 0); } } From a69991d7b832a10e63ea8f57bc77dd18050a3b2b Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Tue, 7 Dec 2021 08:57:12 +0100 Subject: [PATCH 3/3] Bugfix | Bundle below version 2.0 will not support Symfony 6.0 --- .github/workflows/ci.yaml | 1 - README.md | 2 +- .../Core/Exception/AccountNotLinkedException.php | 2 +- composer.json | 12 ++++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9eb7aafcc..15da3a3ac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,7 +78,6 @@ jobs: stability: 'stable' - php: '8.0' symfony-require: '5.4.*' - stability: 'dev' dependencies: 'highest' fail-fast: false steps: diff --git a/README.md b/README.md index 7a2390abf..05375736f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Installation All the installation instructions are located in the documentation, check it for a specific version: -* [__2.0__](https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/1-setting_up_the_bundle.md) (upcoming) - with support for Symfony: `^4.4` & `^5.3` (PHP: `^7.3` & `^8.0`), +* [__2.0__](https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/1-setting_up_the_bundle.md) (upcoming) - with support for Symfony: `^4.4`, `^5.4` & `^6.0` (PHP: `^7.4`, `^8.0`), * [__1.4__](https://github.com/hwi/HWIOAuthBundle/blob/1.4/Resources/doc/1-setting_up_the_bundle.md) (current) - with support for Symfony: `^4.4` & `^5.1` (PHP: `^7.3` & `^8.0`), diff --git a/Security/Core/Exception/AccountNotLinkedException.php b/Security/Core/Exception/AccountNotLinkedException.php index b7e6b64e1..0514db065 100644 --- a/Security/Core/Exception/AccountNotLinkedException.php +++ b/Security/Core/Exception/AccountNotLinkedException.php @@ -50,7 +50,7 @@ public function __unserialize(array $data): void /** * {@inheritdoc} */ - public function getMessageKey() + public function getMessageKey(): string { return 'Account could not be linked correctly.'; } diff --git a/composer.json b/composer.json index ecd900df4..59c3bb64a 100644 --- a/composer.json +++ b/composer.json @@ -130,6 +130,18 @@ }, "conflict": { + "symfony/cache": "^6.0", + "symfony/config": "^6.0", + "symfony/dependency-injection": "^6.0", + "symfony/doctrine-bridge": "^6.0", + "symfony/error-handler": "^6.0", + "symfony/http-foundation": "^6.0", + "symfony/password-hasher": "^6.0", + "symfony/property-info": "^6.0", + "symfony/security-core": "^6.0", + "symfony/security-http": "^6.0", + "symfony/security-csrf": "^6.0", + "symfony/twig-bridge": "^6.0", "twig/twig": "<1.34" },