Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 503cc73

Browse files
Allow installation with PHP 8 (#86)
1 parent 6f108cf commit 503cc73

File tree

8 files changed

+80
-54
lines changed

8 files changed

+80
-54
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Test application
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
- '[0-9]+.x'
9+
- '[0-9]+.[0-9]+'
10+
- '[0-9]+.[0-9]+.x'
11+
12+
jobs:
13+
test:
14+
name: 'PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }}'
15+
runs-on: ubuntu-20.04
16+
env:
17+
COVERAGE: ${{ matrix.coverage }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- php-version: '7.1'
24+
dependencies: 'lowest'
25+
coverage: 'true'
26+
test-command: 'test-ci'
27+
- php-version: '7.1'
28+
test-command: 'test'
29+
- php-version: '7.2'
30+
test-command: 'test'
31+
- php-version: '7.3'
32+
test-command: 'test'
33+
- php-version: '7.4'
34+
test-command: 'test'
35+
- php-version: '8.0'
36+
test-command: 'test'
37+
38+
steps:
39+
- name: Checkout project
40+
uses: actions/checkout@v2
41+
42+
- name: Install and configure PHP
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: ${{ matrix.php-version }}
46+
tools: 'composer:v2'
47+
48+
- name: Install dependencies with Composer
49+
uses: ramsey/composer-install@v1
50+
with:
51+
dependency-versions: ${{ matrix.dependencies }}
52+
composer-options: --prefer-dist --no-suggest
53+
54+
- name: Start HTTP Test Server
55+
run: vendor/bin/http_test_server > /dev/null 2>&1 &
56+
57+
- name: Execute test
58+
run: composer ${{ matrix.test-command }}
59+
60+
- name: Coverage
61+
if: ${{ matrix.coverage }}
62+
run: |
63+
wget https://scrutinizer-ci.com/ocular.phar
64+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
66
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

9+
## [2.0.x] - 2020-02-xx
10+
11+
### Added
12+
13+
- Add Support for PHP 8
914

1015
## [2.0.1] - 2018-12-16
1116

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.1",
18+
"php": "^7.1 || ^8.0",
1919
"php-http/httplug": "^2.0",
2020
"psr/http-client": "^1.0",
2121
"guzzlehttp/guzzle": "^6.0"
2222
},
2323
"require-dev": {
2424
"ext-curl": "*",
25-
"phpunit/phpunit": "^7.4",
26-
"php-http/client-integration-tests": "^2.0"
25+
"phpunit/phpunit": "^7.4 || ^8.4",
26+
"php-http/client-integration-tests": "^2.0 || ^3.0"
2727
},
2828
"provide": {
2929
"php-http/client-implementation": "1.0",

tests/DefaultHttpAdapterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Http\Adapter\Guzzle6\Client;
88
use Http\Client\Tests\HttpClientTest;
9+
use Psr\Http\Client\ClientInterface;
910

1011
/**
1112
* @author David Buchmann <[email protected]>
@@ -15,7 +16,7 @@ class DefaultHttpAdapterTest extends HttpClientTest
1516
/**
1617
* {@inheritdoc}
1718
*/
18-
protected function createHttpAdapter()
19+
protected function createHttpAdapter(): ClientInterface
1920
{
2021
return new Client();
2122
}

tests/HttpAdapterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use GuzzleHttp\Client as GuzzleClient;
88
use Http\Adapter\Guzzle6\Client;
99
use Http\Client\Tests\HttpClientTest;
10+
use Psr\Http\Client\ClientInterface;
1011

1112
/**
1213
* @author GeLo <[email protected]>
@@ -16,7 +17,7 @@ abstract class HttpAdapterTest extends HttpClientTest
1617
/**
1718
* {@inheritdoc}
1819
*/
19-
protected function createHttpAdapter()
20+
protected function createHttpAdapter(): ClientInterface
2021
{
2122
return new Client(new GuzzleClient(['handler' => $this->createHandler()]));
2223
}

tests/HttpAsyncAdapterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use GuzzleHttp\Client as GuzzleClient;
88
use Http\Adapter\Guzzle6\Client;
9+
use Http\Client\HttpAsyncClient;
910
use Http\Client\Tests\HttpAsyncClientTest;
1011

1112
/**
@@ -16,7 +17,7 @@ abstract class HttpAsyncAdapterTest extends HttpAsyncClientTest
1617
/**
1718
* {@inheritdoc}
1819
*/
19-
protected function createHttpAsyncClient()
20+
protected function createHttpAsyncClient(): HttpAsyncClient
2021
{
2122
return new Client(new GuzzleClient(['handler' => $this->createHandler()]));
2223
}

tests/PromiseTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
*/
1414
class PromiseTest extends TestCase
1515
{
16-
/**
17-
* @expectedException \Exception
18-
*/
1916
public function testNonDomainExceptionIsHandled()
2017
{
18+
$this->expectException(\Exception::class);
19+
2120
$request = $this->prophesize('Psr\Http\Message\RequestInterface');
2221
$promise = new RejectedPromise(new \Exception());
2322

0 commit comments

Comments
 (0)