Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add union type to suppress deprecation warning #324

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
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
Loading