From e7f67df2436aa29593305acfdb14258a883e8fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dezs=C5=91=20BICZ=C3=93?= Date: Wed, 8 Nov 2023 13:19:45 +0100 Subject: [PATCH] Fix valid complain by PSALM InvalidArgument: Argument 2 of Http\Promise\Promise::then expects callable(Exception):mixed|null, but impure-Closure(Http\Client\Exception):mixed provided --- src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php b/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php index f1a2f909..30863d99 100644 --- a/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php +++ b/src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php @@ -20,8 +20,8 @@ use Apigee\Edge\Exception\OauthAccessTokenAuthenticationException; use Apigee\Edge\HttpClient\Plugin\Authentication\AbstractOauth; +use Exception; use Http\Client\Common\Plugin; -use Http\Client\Exception; use Http\Promise\Promise; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -62,9 +62,8 @@ public function handleRequest(RequestInterface $request, callable $next, callabl // Mark access token as expired and with that ensure that the authentication plugin gets a new // access token. $this->auth->getTokenStorage()->markExpired(); - $promise = $first($request); - return $promise->wait(); + return $first($request)->wait(); } throw $exception;