Skip to content

Commit 887734d

Browse files
authored
Merge pull request #139 from php-http/guzzle-psr7-2
support guzzle psr7 version 2
2 parents fb0dbce + 11dd897 commit 887734d

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

Diff for: .github/workflows/static.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
uses: actions/checkout@v2
3232

3333
- name: PHP-CS-Fixer
34-
uses: docker://oskarstark/php-cs-fixer-ga
34+
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
3535
with:
3636
args: --dry-run --diff-format udiff

Diff for: CHANGELOG.md

+4
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`.

Diff for: phpstan-baseline.neon

+11-16
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ parameters:
1111
path: src/Authentication/Header.php
1212

1313
-
14-
message: "#^Property Http\\\\Message\\\\Authentication\\\\QueryParam\\:\\:\\$params type has no value type specified in iterable type array\\.$#"
14+
message: "#The Http\\\\Message\\\\Authentication\\\\Matching class is deprecated since version 1.2 and will be removed in 2.0.#"
1515
count: 1
16-
path: src/Authentication/QueryParam.php
16+
path: src/Authentication/Matching.php
1717

1818
-
19-
message: "#^Method Http\\\\Message\\\\Authentication\\\\QueryParam\\:\\:__construct\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
19+
message: "#^Property Http\\\\Message\\\\Authentication\\\\QueryParam\\:\\:\\$params type has no value type specified in iterable type array\\.$#"
2020
count: 1
2121
path: src/Authentication/QueryParam.php
2222

2323
-
24-
message: "#^Parameter \\#2 \\$prefix of function http_build_query expects string, null given\\.$#"
24+
message: "#^Method Http\\\\Message\\\\Authentication\\\\QueryParam\\:\\:__construct\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
2525
count: 1
2626
path: src/Authentication/QueryParam.php
2727

@@ -46,7 +46,7 @@ parameters:
4646
path: src/Cookie.php
4747

4848
-
49-
message: "#^Parameter \\#2 \\$str2 of function strcasecmp expects string, string\\|null given\\.$#"
49+
message: "#^Parameter \\#2 \\$string2 of function strcasecmp expects string, string\\|null given\\.$#"
5050
count: 1
5151
path: src/Cookie.php
5252

@@ -76,7 +76,7 @@ parameters:
7676
path: src/Cookie.php
7777

7878
-
79-
message: "#^Parameter \\#1 \\$str of function rtrim expects string, string\\|null given\\.$#"
79+
message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|null given\\.$#"
8080
count: 1
8181
path: src/Cookie.php
8282

@@ -160,16 +160,6 @@ parameters:
160160
count: 2
161161
path: src/Encoding/Filter/Chunk.php
162162

163-
-
164-
message: "#^Parameter \\#2 \\$bucket of function stream_bucket_append expects object, resource given\\.$#"
165-
count: 2
166-
path: src/Encoding/Filter/Chunk.php
167-
168-
-
169-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
170-
count: 1
171-
path: src/Encoding/Filter/Chunk.php
172-
173163
-
174164
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:fill\\(\\) has no return typehint specified\\.$#"
175165
count: 1
@@ -215,6 +205,11 @@ parameters:
215205
count: 1
216206
path: src/MessageFactory/SlimMessageFactory.php
217207

208+
-
209+
message: "#The Http\\\\Message\\\\RequestMatcher\\\\RegexRequestMatcher class is deprecated since version 1.2 and will be removed in 2.0.#"
210+
count: 1
211+
path: src/RequestMatcher/RegexRequestMatcher.php
212+
218213
-
219214
message: "#^Property Http\\\\Message\\\\RequestMatcher\\\\RequestMatcher\\:\\:\\$methods type has no value type specified in iterable type array\\.$#"
220215
count: 1

Diff for: src/Authentication/QueryParam.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function authenticate(RequestInterface $request)
3838

3939
$params = array_merge($params, $this->params);
4040

41-
$query = http_build_query($params, null, '&');
41+
$query = http_build_query($params, '', '&');
4242

4343
$uri = $uri->withQuery($query);
4444

Diff for: src/UriFactory/GuzzleUriFactory.php

+7-2
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)