Skip to content

Commit 822dbc9

Browse files
authored
Merge pull request #171 from nicolas-grekas/deprec-sync
Deprecate Http\Client\HttpClient and allow psr/http-message v2
2 parents 259f4d3 + 785c0b7 commit 822dbc9

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ 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

99

10-
## [Unreleased]
10+
## [2.4.0] - Unreleased
11+
12+
### Changed
13+
14+
- Allow `psr/http-message` v2 in addition to v1
15+
- Deprecate `Http\Client\HttpClient`, use [PSR-18](https://www.php-fig.org/psr/psr-18/) instead
1116

1217
## [2.3.0] - 2022-02-21
1318

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"php": "^7.1 || ^8.0",
2323
"php-http/promise": "^1.1",
2424
"psr/http-client": "^1.0",
25-
"psr/http-message": "^1.0"
25+
"psr/http-message": "^1.0 || ^2.0"
2626
},
2727
"require-dev": {
2828
"friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",

spec/Exception/HttpExceptionSpec.php

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class HttpExceptionSpec extends ObjectBehavior
1010
{
1111
function let(RequestInterface $request, ResponseInterface $response)
1212
{
13+
$response->getStatusCode()->willReturn(500);
14+
1315
$this->beConstructedWith('message', $request, $response);
1416
}
1517

src/HttpClient.php

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*
1010
* Provide the Httplug HttpClient interface for BC.
1111
* You should typehint Psr\Http\Client\ClientInterface in new code
12+
*
13+
* @deprecated since version 2.4, use Psr\Http\Client\ClientInterface instead; see https://www.php-fig.org/psr/psr-18/
1214
*/
1315
interface HttpClient extends ClientInterface
1416
{

0 commit comments

Comments
 (0)