Skip to content

Commit 94b58b9

Browse files
authored
Refactor, bump minimum required PHP version to 8.2 and support 8.4 (#27)
This bumps the minimum required PHP version to 8.2. PHPSpec is remover in favor of PHPUnit. Scrutinizer CI is removed because we no longer have coverage.
1 parent 73b74a2 commit 94b58b9

12 files changed

+202
-273
lines changed

Diff for: .gitattributes

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
.github/ export-ignore
44
.gitignore export-ignore
55
.php_cs export-ignore
6-
.scrutinizer.yml export-ignore
76
.styleci.yml export-ignore
8-
phpspec.yml.ci export-ignore
9-
phpspec.yml.dist export-ignore
10-
spec/ export-ignore
7+
phpunit.xml export-ignore
8+
tests export-ignore

Diff for: .github/workflows/tests.yml

+10-67
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ on:
55
pull_request:
66

77
jobs:
8-
latest:
9-
name: PHP ${{ matrix.php }} Latest
8+
tests:
9+
name: PHP ${{ matrix.php }} ${{ matrix.dependencies }}
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
13+
php: ['8.2', '8.3', '8.4']
14+
dependencies:
15+
- "lowest"
16+
- "highest"
1417

1518
steps:
1619
- name: Checkout code
@@ -20,72 +23,12 @@ jobs:
2023
uses: shivammathur/setup-php@v2
2124
with:
2225
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
5526
coverage: none
5627

5728
- 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
29+
uses: "ramsey/composer-install@v3"
7530
with:
76-
php-version: 7.4
77-
tools: composer:v2
78-
coverage: xdebug
31+
dependency-versions: "${{ matrix.dependencies }}"
7932

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
33+
- name: Run tests
34+
run: composer test

Diff for: .gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
build/
21
vendor/
32
composer.lock
4-
phpspec.yml
5-
phpunit.xml
3+
/.phpunit.cache/

Diff for: .scrutinizer.yml

-8
This file was deleted.

Diff for: composer.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,31 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.0 || ^8.0",
15-
"psr/log": "^1.0 || ^2 || ^3",
16-
"php-http/client-common": "^1.9 || ^2.0",
17-
"php-http/message": "^1.0",
18-
"symfony/polyfill-php73": "^1.17"
19-
},
20-
"require-dev": {
21-
"phpspec/phpspec": "^5.1 || ^6.0"
14+
"php": "^8.2",
15+
"psr/log": "^2 || ^3",
16+
"php-http/client-common": "^2.0",
17+
"php-http/message": "^1.13"
2218
},
2319
"autoload": {
2420
"psr-4": {
2521
"Http\\Client\\Common\\Plugin\\": "src/"
2622
}
2723
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"Http\\Client\\Common\\Plugin\\": "tests/"
27+
}
28+
},
2829
"scripts": {
29-
"test": "vendor/bin/phpspec run",
30-
"test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci"
30+
"test": "vendor/bin/phpunit"
3131
},
3232
"extra": {
3333
"branch-alias": {
3434
"dev-master": "1.2-dev"
3535
}
36+
},
37+
"require-dev": {
38+
"phpunit/phpunit": "^11.4.3",
39+
"nyholm/psr7": "^1.8"
3640
}
3741
}

Diff for: phpspec.yml.ci

-10
This file was deleted.

Diff for: phpspec.yml.dist

-5
This file was deleted.

Diff for: phpunit.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
shortenArraysForExportThreshold="10"
8+
requireCoverageMetadata="true"
9+
beStrictAboutCoverageMetadata="true"
10+
beStrictAboutOutputDuringTests="true"
11+
displayDetailsOnPhpunitDeprecations="true"
12+
failOnPhpunitDeprecation="true"
13+
failOnRisky="true"
14+
failOnWarning="true">
15+
<testsuites>
16+
<testsuite name="default">
17+
<directory>tests</directory>
18+
</testsuite>
19+
</testsuites>
20+
21+
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
22+
<include>
23+
<directory>src</directory>
24+
</include>
25+
</source>
26+
</phpunit>

Diff for: spec/LoggerPluginSpec.php

-149
This file was deleted.

0 commit comments

Comments
 (0)