Skip to content

Commit

Permalink
Remove deprecated Guzzle function call.
Browse files Browse the repository at this point in the history
The `GuzzleHttp\Psr7\uri_for` function is deprecated and removed in Guzzle 7.2.  Where available `GuzzleHttp\Psr7\Utils::uriFor` is used instead.

Given we support Guzzle 6 and 7, both the method and function call are required to be supported.

Fixes #134.
  • Loading branch information
bencorlett committed Jul 5, 2021
1 parent 1e7e6be commit 03c502c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Signature/EncodesUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Uri;
use function GuzzleHttp\Psr7\uri_for;
use Psr\Http\Message\UriInterface;

trait EncodesUrl
Expand All @@ -17,6 +18,11 @@ trait EncodesUrl
*/
protected function createUrl($uri)
{
if (method_exists(Psr7\Utils::class, 'uriFor')) {
return Psr7\Utils::uriFor($uri);
}

// Deprecated, removed in Guzzle 7.2
return Psr7\uri_for($uri);
}

Expand Down

0 comments on commit 03c502c

Please sign in to comment.