Skip to content

Commit 692eb01

Browse files
Deprecate Http\Client\HttpClient and allow psr/http-message v2
1 parent f640739 commit 692eb01

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
15+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020

2121
- name: Setup PHP
2222
uses: shivammathur/setup-php@v2
@@ -25,15 +25,8 @@ jobs:
2525
tools: composer:v2
2626
coverage: none
2727

28-
- name: Install PHP 7 dependencies
28+
- name: Install dependencies
2929
run: composer update --prefer-dist --no-interaction --no-progress
30-
if: "startsWith(matrix.php, '7.')"
31-
32-
- name: Install PHP 8 dependencies
33-
run: |
34-
composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
35-
composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php
36-
if: "startsWith(matrix.php, '8.')"
3730

3831
- name: Execute tests
3932
run: composer test
@@ -43,11 +36,11 @@ jobs:
4336
runs-on: ubuntu-latest
4437
strategy:
4538
matrix:
46-
php: ['7.1', '7.4', '8.0']
39+
php: ['7.1', '7.4', '8.0', '8.1', '8.2']
4740

4841
steps:
4942
- name: Checkout code
50-
uses: actions/checkout@v2
43+
uses: actions/checkout@v3
5144

5245
- name: Setup PHP
5346
uses: shivammathur/setup-php@v2
@@ -70,7 +63,7 @@ jobs:
7063

7164
steps:
7265
- name: Checkout code
73-
uses: actions/checkout@v2
66+
uses: actions/checkout@v3
7467

7568
- name: Setup PHP
7669
uses: shivammathur/setup-php@v2

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: PHPStan
1919
uses: docker://oskarstark/phpstan-ga
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3030

3131
- name: PHP-CS-Fixer
3232
uses: docker://oskarstark/php-cs-fixer-ga

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
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": {
28-
"friends-of-phpspec/phpspec-code-coverage": "^4.1",
29-
"phpspec/phpspec": "^5.1 || ^6.0"
28+
"friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
29+
"phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
3030
},
3131
"extra": {
3232
"branch-alias": {

spec/Exception/HttpExceptionSpec.php

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)