Skip to content

Commit

Permalink
feat: drop support for php < 8.1,
Browse files Browse the repository at this point in the history
drop support for symfony < 5.4,
  • Loading branch information
Chris8934 committed Jan 23, 2024
1 parent f61eca2 commit 963102b
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 33 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['8.1', '8.2', '8.3']

steps:
- name: Checkout code
Expand Down Expand Up @@ -61,14 +61,12 @@ jobs:
strategy:
matrix:
include:
- symfony: '4.4.*'
php-version: '7.1'
- symfony: '5.4.*'
php-version: '7.4'
- symfony: '6.4.*'
php-version: '8.2'
- symfony: '7.0.*'
- symfony: '5'
php-version: '8.1'
- symfony: '6'
php-version: '8.2'
- symfony: '7'
php-version: '8.3'

steps:
- name: Checkout code
Expand Down Expand Up @@ -103,7 +101,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
tools: composer:v2
coverage: xdebug

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/vendor/

.phpunit.result.cache
.phpunit.cache
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## unreleased

- drop support for php < 8.1
- drop support for symfony < 5.4
- Cleaned up phpdoc.

## 2.7.1 - 2023-11-30
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php-http/httplug": "^2.0",
"php": "^8.1",
"php-http/httplug": "^2.4",
"php-http/message": "^1.6",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0",
"symfony/polyfill-php80": "^1.17"
"psr/http-message": "^2.0",
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"doctrine/instantiator": "^1.1",
"guzzlehttp/psr7": "^1.4",
"nyholm/psr7": "^1.2",
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
"phpspec/prophecy": "^1.10.2",
"phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7"
"doctrine/instantiator": "^2.0",
"guzzlehttp/psr7": "^2.6",
"nyholm/psr7": "^1.8",
"phpspec/phpspec": "^7.5",
"phpspec/prophecy": "^1.18",
"phpunit/phpunit": "^10.5.8",
"phpspec/prophecy-phpunit": "^2.1"
},
"suggest": {
"ext-json": "To detect JSON responses with the ContentTypePlugin",
Expand Down
21 changes: 11 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="./vendor/autoload.php"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="./vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>

<testsuites>
<testsuite name="HTTPlug unit tests">
<directory>./tests</directory>
</testsuite>
</testsuites>

<testsuites>
<testsuite name="HTTPlug unit tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Plugin/RedirectPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function (RequestInterface $request) {
$this->assertSame('https://example.com/other', $response->getHeaderLine('uri'));
}

public function provideRedirections(): array
public static function provideRedirections(): array
{
return [
'no path on target' => ['https://example.com/path?query=value', 'https://example.com?query=value', 'https://example.com?query=value'],
Expand Down
3 changes: 3 additions & 0 deletions tests/PluginChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
use Http\Client\Common\PluginChain;
use Http\Promise\Promise;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Message\RequestInterface;

class PluginChainTest extends TestCase
{
use ProphecyTrait;

private function createPlugin(callable $func): Plugin
{
return new class($func) implements Plugin {
Expand Down
5 changes: 4 additions & 1 deletion tests/PluginClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

class PluginClientBuilderTest extends TestCase
{
use ProphecyTrait;

/** @dataProvider clientProvider */
public function testPriority(string $client): void
{
Expand Down Expand Up @@ -71,7 +74,7 @@ function (): array {
$this->assertSame(5, $options['max_restarts']);
}

public function clientProvider(): iterable
public static function clientProvider(): iterable
{
yield 'sync\'d http client' => [HttpClient::class];
yield 'async\'d http client' => [HttpAsyncClient::class];
Expand Down
2 changes: 1 addition & 1 deletion tests/PluginClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testRestartChain(PluginClient $client, string $method, string $r
$this->assertInstanceOf($returnType, $result);
}

public function clientAndMethodProvider()
public static function clientAndMethodProvider()
{
$syncClient = new class() implements ClientInterface {
public function sendRequest(RequestInterface $request): ResponseInterface
Expand Down

0 comments on commit 963102b

Please sign in to comment.