Skip to content

Commit

Permalink
Fix valid complain by PSALM
Browse files Browse the repository at this point in the history
InvalidArgument: Argument 2 of Http\Promise\Promise::then expects callable(Exception):mixed|null, but impure-Closure(Http\Client\Exception):mixed provided
  • Loading branch information
mxr576 committed Nov 8, 2023
1 parent da21a00 commit e7f67df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/HttpClient/Plugin/RetryOauthAuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e7f67df

Please sign in to comment.