diff --git a/src/ClientInterface.php b/src/ClientInterface.php index bfe7f7ea..1194d452 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -19,7 +19,6 @@ namespace Apigee\Edge; use Apigee\Edge\HttpClient\Utility\JournalInterface; -use Http\Message\UriFactory; use Psr\Http\Client\ClientInterface as HttpClient; use Psr\Http\Message\ResponseInterface; @@ -75,8 +74,12 @@ public function getJournal(): JournalInterface; /** * Returns the URI factory used by the Client. + * + * @return \Http\Message\UriFactory|\Psr\Http\Message\UriFactoryInterface + * + * @todo Restore native return type as \Psr\Http\Message\UriFactoryInterface in 4.0.0. */ - public function getUriFactory(): UriFactory; + public function getUriFactory(); /** * Returns the version of the API client. 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;