Skip to content

Commit 5dd5e1b

Browse files
committed
feat: drop support for php < 8.1,
drop support for symfony < 5.4,
1 parent a7640b6 commit 5dd5e1b

10 files changed

+43
-33
lines changed

.github/workflows/static.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
run: composer remove --dev friends-of-phpspec/phpspec-code-coverage phpspec/phpspec
2020

2121
- name: PHPStan
22-
uses: OskarStark/phpstan-ga@0.12.32
22+
uses: docker://oskarstark/phpstan-ga
2323
env:
2424
REQUIRE_DEV: false
2525
with:

.github/workflows/tests.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: tests
22

33
on:
44
push:
5-
branches:
6-
- '*.x'
5+
branches:
6+
- '*.x'
77
pull_request:
88

99
jobs:
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
15+
php: ['8.1', '8.2', '8.3']
1616

1717
steps:
1818
- name: Checkout code
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
strategy:
4444
matrix:
45-
php: ['7.1', '7.4', '8.2', '8.3']
45+
php: ['7.1', '7.4', '8.2']
4646

4747
steps:
4848
- name: Checkout code
@@ -69,12 +69,12 @@ jobs:
6969
strategy:
7070
matrix:
7171
include:
72-
- symfony: '4'
73-
php-version: '7.1'
7472
- symfony: '5'
75-
php-version: '7.4'
73+
php-version: '8.1'
7674
- symfony: '6'
7775
php-version: '8.2'
76+
- symfony: '7'
77+
php-version: '8.3'
7878

7979
steps:
8080
- name: Checkout code
@@ -112,7 +112,7 @@ jobs:
112112
- name: Setup PHP
113113
uses: shivammathur/setup-php@v2
114114
with:
115-
php-version: 7.4
115+
php-version: 8.1
116116
tools: composer:v2
117117
coverage: xdebug
118118

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/vendor/
1010

1111
.phpunit.result.cache
12+
.phpunit.cache

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## unreleased
44

5+
- drop support for php < 8.1
6+
- drop support for symfony < 5.4
57
- Cleaned up phpdoc.
68

79
## 2.7.1 - 2023-11-30

composer.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.1 || ^8.0",
15-
"php-http/httplug": "^2.0",
14+
"php": "^8.1",
15+
"php-http/httplug": "^2.4",
1616
"php-http/message": "^1.6",
1717
"psr/http-client": "^1.0",
1818
"psr/http-factory": "^1.0",
19-
"psr/http-message": "^1.0 || ^2.0",
20-
"symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0",
21-
"symfony/polyfill-php80": "^1.17"
19+
"psr/http-message": "^2.0",
20+
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0"
2221
},
2322
"require-dev": {
24-
"doctrine/instantiator": "^1.1",
25-
"guzzlehttp/psr7": "^1.4",
26-
"nyholm/psr7": "^1.2",
27-
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
28-
"phpspec/prophecy": "^1.10.2",
29-
"phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7"
23+
"doctrine/instantiator": "^2.0",
24+
"guzzlehttp/psr7": "^2.6",
25+
"nyholm/psr7": "^1.8",
26+
"phpspec/phpspec": "^7.5",
27+
"phpspec/prophecy": "^1.18",
28+
"phpunit/phpunit": "^10.5.8",
29+
"phpspec/prophecy-phpunit": "^2.1"
3030
},
3131
"suggest": {
3232
"ext-json": "To detect JSON responses with the ContentTypePlugin",

phpunit.xml.dist

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="./vendor/autoload.php"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="./vendor/autoload.php"
44
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true">
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
cacheDirectory=".phpunit.cache"
7+
>
8+
9+
<testsuites>
10+
<testsuite name="HTTPlug unit tests">
11+
<directory>./tests</directory>
12+
</testsuite>
13+
</testsuites>
814

9-
<testsuites>
10-
<testsuite name="HTTPlug unit tests">
11-
<directory suffix="Test.php">./tests</directory>
12-
</testsuite>
13-
</testsuites>
1415
</phpunit>

tests/Plugin/RedirectPluginTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function (RequestInterface $request) {
7878
$this->assertSame('https://example.com/other', $response->getHeaderLine('uri'));
7979
}
8080

81-
public function provideRedirections(): array
81+
public static function provideRedirections(): array
8282
{
8383
return [
8484
'no path on target' => ['https://example.com/path?query=value', 'https://example.com?query=value', 'https://example.com?query=value'],

tests/PluginChainTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
use Http\Client\Common\PluginChain;
1010
use Http\Promise\Promise;
1111
use PHPUnit\Framework\TestCase;
12+
use Prophecy\PhpUnit\ProphecyTrait;
1213
use Psr\Http\Message\RequestInterface;
1314

1415
class PluginChainTest extends TestCase
1516
{
17+
use ProphecyTrait;
18+
1619
private function createPlugin(callable $func): Plugin
1720
{
1821
return new class($func) implements Plugin {

tests/PluginClientBuilderTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
use Http\Client\HttpAsyncClient;
1111
use Http\Client\HttpClient;
1212
use PHPUnit\Framework\TestCase;
13+
use Prophecy\PhpUnit\ProphecyTrait;
1314

1415
class PluginClientBuilderTest extends TestCase
1516
{
17+
use ProphecyTrait;
18+
1619
/** @dataProvider clientProvider */
1720
public function testPriority(string $client): void
1821
{
@@ -71,7 +74,7 @@ function (): array {
7174
$this->assertSame(5, $options['max_restarts']);
7275
}
7376

74-
public function clientProvider(): iterable
77+
public static function clientProvider(): iterable
7578
{
7679
yield 'sync\'d http client' => [HttpClient::class];
7780
yield 'async\'d http client' => [HttpAsyncClient::class];

tests/PluginClientTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testRestartChain(PluginClient $client, string $method, string $r
3131
$this->assertInstanceOf($returnType, $result);
3232
}
3333

34-
public function clientAndMethodProvider()
34+
public static function clientAndMethodProvider()
3535
{
3636
$syncClient = new class() implements ClientInterface {
3737
public function sendRequest(RequestInterface $request): ResponseInterface

0 commit comments

Comments
 (0)