From 353e87c7d8ee7e264123ed90f257740512ca3390 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 31 Dec 2024 14:42:03 +0100 Subject: [PATCH] fix issues reported by PHPStan --- .github/workflows/ci.yaml | 4 ---- phpstan.neon | 1 + .../CompilerPass/ResourceOwnerCompilerPass.php | 2 +- src/Security/Http/Firewall/RefreshAccessTokenListener.php | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 35b10cdd7..4db3588c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,10 +2,6 @@ name: CI on: push: - branches: - - master - paths-ignore: - - '**.md' pull_request: paths: - '.github/workflows/**' diff --git a/phpstan.neon b/phpstan.neon index 216329555..b88ecced5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -19,3 +19,4 @@ parameters: - '#Parameter \$event of method HWI\\Bundle\\OAuthBundle\\Controller\\Connect\\AbstractController::dispatch\(\) has invalid type Symfony\\Component\\EventDispatcher\\Event.#' - '#Parameter \#2 \$array of function implode expects array, array given.#' - '#PHPDoc type DOMNode of property HWI\\Bundle\\OAuthBundle\\OAuth\\Response\\SensioConnectUserResponse::\$data is not covariant with PHPDoc type array of overridden property HWI\\Bundle\\OAuthBundle\\OAuth\\Response\\AbstractUserResponse::\$data#' + - '#Call to function method_exists\(\) with Symfony\\Component\\Security\\Http\\Authenticator\\Debug\\TraceableAuthenticator#' diff --git a/src/DependencyInjection/CompilerPass/ResourceOwnerCompilerPass.php b/src/DependencyInjection/CompilerPass/ResourceOwnerCompilerPass.php index bc822b972..1046ae7ca 100644 --- a/src/DependencyInjection/CompilerPass/ResourceOwnerCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/ResourceOwnerCompilerPass.php @@ -71,7 +71,7 @@ private function registerResourceOwnerTypeClassParameters(ContainerBuilder $cont return; } - if (!($match['type'] ?? null)) { + if (!$match['type']) { continue; } diff --git a/src/Security/Http/Firewall/RefreshAccessTokenListener.php b/src/Security/Http/Firewall/RefreshAccessTokenListener.php index 2407f4b73..c9598d8db 100644 --- a/src/Security/Http/Firewall/RefreshAccessTokenListener.php +++ b/src/Security/Http/Firewall/RefreshAccessTokenListener.php @@ -40,7 +40,7 @@ protected function refreshToken(OAuthToken $token): OAuthToken return $this->authenticator->refreshToken($token); } - if ($this->authenticator instanceof TraceableAuthenticator) { + if ($this->authenticator instanceof TraceableAuthenticator && method_exists($this->authenticator, 'getAuthenticator')) { $authenticator = $this->authenticator->getAuthenticator(); if ($authenticator instanceof OAuthAuthenticator) {