diff --git a/CHANGELOG.md b/CHANGELOG.md index 26483c2..cc5ec4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/composer.json b/composer.json index c169089..7391770 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/spec/Exception/HttpExceptionSpec.php b/spec/Exception/HttpExceptionSpec.php index 3658f56..20eb58e 100644 --- a/spec/Exception/HttpExceptionSpec.php +++ b/spec/Exception/HttpExceptionSpec.php @@ -10,6 +10,8 @@ class HttpExceptionSpec extends ObjectBehavior { function let(RequestInterface $request, ResponseInterface $response) { + $response->getStatusCode()->willReturn(500); + $this->beConstructedWith('message', $request, $response); } diff --git a/src/HttpClient.php b/src/HttpClient.php index 4442bd0..22b94aa 100644 --- a/src/HttpClient.php +++ b/src/HttpClient.php @@ -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 {