Skip to content

Commit a1cb3e2

Browse files
authored
Merge pull request #67 from GrahamCampbell/patch-1
PHP 8.0 support
2 parents 2895cfb + 5b3aedd commit a1cb3e2

File tree

5 files changed

+95
-54
lines changed

5 files changed

+95
-54
lines changed

Diff for: .gitattributes

-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
/.php_cs export-ignore
66
/.scrutinizer.yml export-ignore
77
/.styleci.yml export-ignore
8-
/.travis.yml export-ignore
98
/behat.yml.dist export-ignore
109
/features/ export-ignore
1110
/phpspec.ci.yml export-ignore
1211
/phpspec.yml.dist export-ignore
13-
/phpunit.xml.dist export-ignore
1412
/spec/ export-ignore
15-
/tests/ export-ignore

Diff for: .github/workflows/tests.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
latest:
9+
name: PHP ${{ matrix.php }} Latest
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php }}
23+
tools: composer:v2
24+
coverage: none
25+
26+
- name: Install PHP 7 dependencies
27+
run: composer update --prefer-dist --no-interaction --no-progress
28+
if: "matrix.php != '8.0'"
29+
30+
- name: Install PHP 8 dependencies
31+
run: |
32+
composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
33+
composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php
34+
if: "matrix.php == '8.0'"
35+
36+
- name: Execute tests
37+
run: composer test
38+
39+
lowest:
40+
name: PHP ${{ matrix.php }} Lowest
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
php: ['7.1', '7.2', '7.3', '7.4']
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v2
49+
50+
- name: Setup PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: ${{ matrix.php }}
54+
tools: composer:v2
55+
coverage: none
56+
57+
- name: Install dependencies
58+
run: |
59+
composer require "sebastian/comparator:^3.0.2" --no-interaction --no-update
60+
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
61+
62+
- name: Execute tests
63+
run: composer test
64+
65+
coverage:
66+
name: Code Coverage
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v2
72+
73+
- name: Setup PHP
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
php-version: 7.4
77+
tools: composer:v2
78+
coverage: xdebug
79+
80+
- name: Install dependencies
81+
run: |
82+
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
83+
composer update --prefer-dist --no-interaction --no-progress
84+
85+
- name: Execute tests
86+
run: composer test-ci
87+
88+
- name: Upload coverage
89+
run: |
90+
wget https://scrutinizer-ci.com/ocular.phar
91+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

Diff for: .travis.yml

-44
This file was deleted.

Diff for: composer.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.1",
14+
"php": "^7.1 || ^8.0",
1515
"psr/cache": "^1.0",
1616
"php-http/client-common": "^1.9 || ^2.0",
1717
"php-http/message-factory": "^1.0",
1818
"symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0"
1919
},
2020
"require-dev": {
21-
"phpspec/phpspec": "^2.5",
22-
"henrikbjorn/phpspec-code-coverage" : "^1.0"
21+
"phpspec/phpspec": "^5.1 || ^6.0"
2322
},
2423
"autoload": {
2524
"psr-4": {
@@ -39,7 +38,5 @@
3938
"branch-alias": {
4039
"dev-master": "1.6-dev"
4140
}
42-
},
43-
"prefer-stable": true,
44-
"minimum-stability": "dev"
41+
}
4542
}

Diff for: phpspec.ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ suites:
44
psr4_prefix: Http\Client\Common\Plugin
55
formatter.name: pretty
66
extensions:
7-
- PhpSpec\Extension\CodeCoverageExtension
7+
FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension: ~
88
code_coverage:
99
format: clover
1010
output: build/coverage.xml

0 commit comments

Comments
 (0)