diff --git a/src/Signature/EncodesUrl.php b/src/Signature/EncodesUrl.php index 5aab03e..a327cb6 100644 --- a/src/Signature/EncodesUrl.php +++ b/src/Signature/EncodesUrl.php @@ -4,6 +4,7 @@ use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\Uri; +use function GuzzleHttp\Psr7\uri_for; use Psr\Http\Message\UriInterface; trait EncodesUrl @@ -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); }