Skip to content

Commit

Permalink
Deprecate Http\Client\HttpClient and allow psr/http-message v2
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Apr 11, 2023
1 parent f640739 commit 692eb01
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -25,15 +25,8 @@ jobs:
tools: composer:v2
coverage: none

- name: Install PHP 7 dependencies
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
if: "startsWith(matrix.php, '7.')"

- name: Install PHP 8 dependencies
run: |
composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php
if: "startsWith(matrix.php, '8.')"

- name: Execute tests
run: composer test
Expand All @@ -43,11 +36,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.4', '8.0']
php: ['7.1', '7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -70,7 +63,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
Expand All @@ -26,7 +26,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
Expand Down
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"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",
"phpspec/phpspec": "^5.1 || ^6.0"
"friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
"phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
},
"extra": {
"branch-alias": {
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 692eb01

Please sign in to comment.