Skip to content

Commit 31545b8

Browse files
authored
Add support for PHP 8
1 parent 96895d0 commit 31545b8

File tree

7 files changed

+39
-38
lines changed

7 files changed

+39
-38
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
strategy:
1616
matrix:
1717
php-version:
18-
- '7.1'
1918
- '7.2'
2019
- '7.3'
2120
- '7.4'
21+
- '8.0'
2222
steps:
2323
- name: Install php
2424
uses: shivammathur/setup-php@v2

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Add support for PHP 8.0
10+
11+
### Removed
12+
- Removed support for PHP 7.1
813

914
## [4.1.0] - 2021-02-03
1015
### Added

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ All clients can be replaced without any side effects.
2323

2424
If you don't have any client implementation installed, use the following:
2525
```bash
26-
composer require php-http/guzzle6-adapter guzzlehttp/psr7
26+
composer require guzzlehttp/guzzle
2727
```
2828

2929
If you don't have any factory implementation installed, use the following:

composer.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
"license": "MIT",
66
"version": "4.1.0",
77
"require": {
8-
"php": "^7.1",
8+
"php": "^7.2|^8.0",
99
"ext-json": "*",
1010
"psr/http-client-implementation": "^1.0",
1111
"psr/http-message-implementation": "^1.0",
1212
"psr/http-factory-implementation": "^1.0",
1313
"php-http/discovery": "^1.0"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "^7.5 || ^6.5",
17-
"php-http/guzzle6-adapter": "^2.0",
18-
"guzzlehttp/psr7": "^1.6",
16+
"phpunit/phpunit": "^9.0 || ^7.5",
17+
"guzzlehttp/guzzle": "^7.0",
1918
"object-calisthenics/phpcs-calisthenics-rules": "^3.5 || ^2.0",
2019
"http-interop/http-factory-guzzle": "^1.0",
2120
"php-http/mock-client": "^1.3",
22-
"fzaninotto/faker": "^1.9",
21+
"fakerphp/faker": "^1.13",
2322
"phpstan/phpstan": "^0.12.23"
2423
},
2524
"suggest": {

phpunit.xml.dist

+24-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.1/phpunit.xsd"
4-
bootstrap="./tests/bootstrap.php"
5-
cacheResult="false">
6-
<testsuites>
7-
<testsuite name="All">
8-
<directory suffix="Test.php">tests</directory>
9-
</testsuite>
10-
<testsuite name="Unit">
11-
<directory suffix="Test.php">tests/Unit</directory>
12-
</testsuite>
13-
<testsuite name="Integration">
14-
<directory suffix="Test.php">tests/Integration</directory>
15-
</testsuite>
16-
<testsuite name="Functional">
17-
<directory suffix="Test.php">tests/Functional</directory>
18-
</testsuite>
19-
</testsuites>
20-
<filter>
21-
<whitelist processUncoveredFilesFromWhitelist="true">
22-
<directory suffix=".php">./src</directory>
23-
<exclude>
24-
<directory>./tests</directory>
25-
<directory>./vendor</directory>
26-
</exclude>
27-
</whitelist>
28-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="./tests/bootstrap.php" cacheResult="false">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
7+
<exclude>
8+
<directory>./tests</directory>
9+
<directory>./vendor</directory>
10+
</exclude>
11+
</coverage>
12+
<testsuites>
13+
<testsuite name="All">
14+
<directory suffix="Test.php">tests</directory>
15+
</testsuite>
16+
<testsuite name="Unit">
17+
<directory suffix="Test.php">tests/Unit</directory>
18+
</testsuite>
19+
<testsuite name="Integration">
20+
<directory suffix="Test.php">tests/Integration</directory>
21+
</testsuite>
22+
<testsuite name="Functional">
23+
<directory suffix="Test.php">tests/Functional</directory>
24+
</testsuite>
25+
</testsuites>
2926
</phpunit>

tests/Functional/AbstractTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract class AbstractTestCase extends TestCase
1616
/**
1717
* Setup resources for all tests
1818
*/
19-
protected function setUp()
19+
protected function setUp(): void
2020
{
2121
parent::setUp();
2222
Version::getInstance()->addPluginVersion('functional-test');

tests/Unit/Util/VersionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public function testGetInstance()
2323
public function testGetVersion()
2424
{
2525
$instance = Version::getInstance();
26-
$this->assertContains('Plugin ', $instance->getVersion());
27-
$this->assertContains('PHP-SDK ', $instance->getVersion());
26+
$this->assertStringContainsString('Plugin ', $instance->getVersion());
27+
$this->assertStringContainsString('PHP-SDK ', $instance->getVersion());
2828
}
2929

3030
/**
@@ -43,6 +43,6 @@ public function testGetPluginVersion()
4343
{
4444
$instance = Version::getInstance();
4545
$instance->addPluginVersion('foobar');
46-
$this->assertContains('foobar', $instance->getPluginVersion());
46+
$this->assertStringContainsString('foobar', $instance->getPluginVersion());
4747
}
4848
}

0 commit comments

Comments
 (0)