Skip to content

Commit

Permalink
Merge pull request #171 from nicolas-grekas/deprec-sync
Browse files Browse the repository at this point in the history
Deprecate Http\Client\HttpClient and allow psr/http-message v2
  • Loading branch information
dbu authored Apr 14, 2023
2 parents 259f4d3 + 785c0b7 commit 822dbc9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [Unreleased]
## [2.4.0] - Unreleased

### Changed

- Allow `psr/http-message` v2 in addition to v1
- Deprecate `Http\Client\HttpClient`, use [PSR-18](https://www.php-fig.org/psr/psr-18/) instead

## [2.3.0] - 2022-02-21

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"php": "^7.1 || ^8.0",
"php-http/promise": "^1.1",
"psr/http-client": "^1.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
Expand Down
2 changes: 2 additions & 0 deletions spec/Exception/HttpExceptionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class HttpExceptionSpec extends ObjectBehavior
{
function let(RequestInterface $request, ResponseInterface $response)
{
$response->getStatusCode()->willReturn(500);

$this->beConstructedWith('message', $request, $response);
}

Expand Down
2 changes: 2 additions & 0 deletions src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* Provide the Httplug HttpClient interface for BC.
* You should typehint Psr\Http\Client\ClientInterface in new code
*
* @deprecated since version 2.4, use Psr\Http\Client\ClientInterface instead; see https://www.php-fig.org/psr/psr-18/
*/
interface HttpClient extends ClientInterface
{
Expand Down

0 comments on commit 822dbc9

Please sign in to comment.