Skip to content

Commit 963102b

Browse files
committed
feat: drop support for php < 8.1,
drop support for symfony < 5.4,
1 parent f61eca2 commit 963102b

9 files changed

+41
-33
lines changed

Diff for: .github/workflows/tests.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -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
@@ -61,14 +61,12 @@ jobs:
6161
strategy:
6262
matrix:
6363
include:
64-
- symfony: '4.4.*'
65-
php-version: '7.1'
66-
- symfony: '5.4.*'
67-
php-version: '7.4'
68-
- symfony: '6.4.*'
69-
php-version: '8.2'
70-
- symfony: '7.0.*'
64+
- symfony: '5'
65+
php-version: '8.1'
66+
- symfony: '6'
7167
php-version: '8.2'
68+
- symfony: '7'
69+
php-version: '8.3'
7270

7371
steps:
7472
- name: Checkout code
@@ -103,7 +101,7 @@ jobs:
103101
- name: Setup PHP
104102
uses: shivammathur/setup-php@v2
105103
with:
106-
php-version: 7.4
104+
php-version: 8.1
107105
tools: composer:v2
108106
coverage: xdebug
109107

Diff for: .gitignore

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

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

Diff for: 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

Diff for: 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",

Diff for: 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>

Diff for: 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'],

Diff for: 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 {

Diff for: 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];

Diff for: 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)