Skip to content

Commit 9b8d8f7

Browse files
committed
support guzzle psr7 version 2
1 parent fb0dbce commit 9b8d8f7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
77
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [1.11.1] - 2021-05-24
10+
11+
- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleUriFactory.
12+
913
## [1.11.0] - 2020-02-01
1014

1115
- Migrated from `zendframework/zend-diactoros` to `laminas/laminas-diactoros`.

src/UriFactory/GuzzleUriFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace Http\Message\UriFactory;
44

5-
use GuzzleHttp\Psr7;
5+
use function GuzzleHttp\Psr7\uri_for;
6+
use GuzzleHttp\Psr7\Utils;
67
use Http\Message\UriFactory;
78

89
/**
@@ -19,6 +20,10 @@ final class GuzzleUriFactory implements UriFactory
1920
*/
2021
public function createUri($uri)
2122
{
22-
return Psr7\uri_for($uri);
23+
if (class_exists(Utils::class)) {
24+
return Utils::uriFor($uri);
25+
}
26+
27+
return uri_for($uri);
2328
}
2429
}

0 commit comments

Comments
 (0)