Skip to content

Commit 910880e

Browse files
authored
Merge pull request #64 from php-http/fix-bc-breaks
fix accidental bc breaks
2 parents 5a4e338 + ed6615b commit 910880e

File tree

4 files changed

+32
-29
lines changed

4 files changed

+32
-29
lines changed

CHANGELOG.md

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

9+
## [3.1.3] - 2025-12-08
10+
11+
- Fixed BC breaks accidentally introduced in 3.1.2
912

1013
## [3.1.2] - 2025-12-08
1114

src/HttpAsyncClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function testSuccessiveCallMustUseResponseInterface()
3535
{
3636
$request = self::$messageFactory->createRequest(
3737
'GET',
38-
self::getUri(),
39-
self::$defaultHeaders
38+
$this->getUri(),
39+
$this->defaultHeaders
4040
);
4141

4242
$promise = $this->httpAsyncClient->sendAsyncRequest($request);
@@ -63,7 +63,7 @@ public function testSuccessiveInvalidCallMustUseException()
6363
$request = self::$messageFactory->createRequest(
6464
'GET',
6565
$this->getInvalidUri(),
66-
self::$defaultHeaders
66+
$this->defaultHeaders
6767
);
6868

6969
$promise = $this->httpAsyncClient->sendAsyncRequest($request);
@@ -136,7 +136,7 @@ public function testSendAsyncWithInvalidUri()
136136
$request = self::$messageFactory->createRequest(
137137
'GET',
138138
$this->getInvalidUri(),
139-
self::$defaultHeaders
139+
$this->defaultHeaders
140140
);
141141

142142
$exception = null;

src/HttpBaseTest.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class HttpBaseTest extends TestCase
3434
/**
3535
* @var array
3636
*/
37-
protected static $defaultHeaders = [
37+
protected $defaultHeaders = [
3838
'Connection' => 'close',
3939
'User-Agent' => 'PHP HTTP Adapter',
4040
'Content-Length' => '0',
@@ -59,13 +59,13 @@ public static function tearDownAfterClass(): void
5959
}
6060
}
6161

62-
public static function requestProvider(): array
62+
public function requestProvider(): array
6363
{
6464
$sets = [
65-
'methods' => self::getMethods(),
66-
'uris' => [self::getUri()],
67-
'headers' => self::getHeaders(),
68-
'body' => self::getBodies(),
65+
'methods' => $this->getMethods(),
66+
'uris' => [$this->getUri()],
67+
'headers' => $this->getHeaders(),
68+
'body' => $this->getBodies(),
6969
];
7070

7171
$cartesianProduct = new CartesianProduct($sets);
@@ -82,21 +82,21 @@ public static function requestProvider(): array
8282
});
8383
}
8484

85-
public static function requestWithOutcomeProvider(): array
85+
public function requestWithOutcomeProvider(): array
8686
{
8787
$sets = [
88-
'urisAndOutcomes' => self::getUrisAndOutcomes(),
89-
'protocolVersions' => self::getProtocolVersions(),
90-
'headers' => self::getHeaders(),
91-
'body' => self::getBodies(),
88+
'urisAndOutcomes' => $this->getUrisAndOutcomes(),
89+
'protocolVersions' => $this->getProtocolVersions(),
90+
'headers' => $this->getHeaders(),
91+
'body' => $this->getBodies(),
9292
];
9393

9494
$cartesianProduct = new CartesianProduct($sets);
9595

9696
return $cartesianProduct->compute();
9797
}
9898

99-
private static function getMethods(): array
99+
private function getMethods(): array
100100
{
101101
return [
102102
'GET',
@@ -114,7 +114,7 @@ private static function getMethods(): array
114114
*
115115
* @return string|null
116116
*/
117-
protected static function getUri(array $query = [])
117+
protected function getUri(array $query = [])
118118
{
119119
return !empty($query)
120120
? PHPUnitUtility::getUri().'?'.http_build_query($query, '', '&')
@@ -132,25 +132,25 @@ protected function getInvalidUri()
132132
/**
133133
* @return array
134134
*/
135-
private static function getUrisAndOutcomes()
135+
private function getUrisAndOutcomes()
136136
{
137137
return [
138138
[
139-
self::getUri(['client_error' => true]),
139+
$this->getUri(['client_error' => true]),
140140
[
141141
'statusCode' => 400,
142142
'reasonPhrase' => 'Bad Request',
143143
],
144144
],
145145
[
146-
self::getUri(['server_error' => true]),
146+
$this->getUri(['server_error' => true]),
147147
[
148148
'statusCode' => 500,
149149
'reasonPhrase' => 'Internal Server Error',
150150
],
151151
],
152152
[
153-
self::getUri(['redirect' => true]),
153+
$this->getUri(['redirect' => true]),
154154
[
155155
'statusCode' => 302,
156156
'reasonPhrase' => 'Found',
@@ -163,41 +163,41 @@ private static function getUrisAndOutcomes()
163163
/**
164164
* @return array
165165
*/
166-
private static function getProtocolVersions()
166+
private function getProtocolVersions()
167167
{
168168
return ['1.1', '1.0'];
169169
}
170170

171171
/**
172172
* @return string[]
173173
*/
174-
private static function getHeaders()
174+
private function getHeaders()
175175
{
176-
$headers = self::$defaultHeaders;
176+
$headers = $this->defaultHeaders;
177177
$headers['Accept-Charset'] = 'utf-8';
178178
$headers['Accept-Language'] = 'en';
179179

180180
return [
181-
self::$defaultHeaders,
181+
$this->defaultHeaders,
182182
$headers,
183183
];
184184
}
185185

186186
/**
187187
* @return array
188188
*/
189-
private static function getBodies()
189+
private function getBodies()
190190
{
191191
return [
192192
null,
193-
http_build_query(self::getData(), '', '&'),
193+
http_build_query($this->getData(), '', '&'),
194194
];
195195
}
196196

197197
/**
198198
* @return array
199199
*/
200-
private static function getData()
200+
private function getData()
201201
{
202202
return ['param1' => 'foo', 'param2' => ['bar', ['baz']]];
203203
}

src/HttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testSendWithInvalidUri()
107107
$request = self::$messageFactory->createRequest(
108108
'GET',
109109
$this->getInvalidUri(),
110-
self::$defaultHeaders
110+
$this->defaultHeaders
111111
);
112112

113113
$this->expectException(NetworkExceptionInterface::class);

0 commit comments

Comments
 (0)