Skip to content

Commit d7e62aa

Browse files
committed
Refactor
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 d7e62aa

File tree

12 files changed

+226
-272
lines changed

12 files changed

+226
-272
lines changed

.gitattributes

Lines changed: 2 additions & 4 deletions
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

.github/workflows/tests.yml

Lines changed: 10 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +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']
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']
13+
php: ['8.2', '8.3', '8.4']
14+
dependencies:
15+
- "lowest"
16+
- "highest"
4517

4618
steps:
4719
- name: Checkout code
@@ -55,37 +27,9 @@ jobs:
5527
coverage: none
5628

5729
- 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
30+
uses: "ramsey/composer-install@v3"
7531
with:
76-
php-version: 7.4
77-
tools: composer:v2
78-
coverage: xdebug
32+
dependency-versions: "${{ matrix.dependencies }}"
7933

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

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
build/
22
vendor/
33
composer.lock
4-
phpspec.yml
5-
phpunit.xml

.scrutinizer.yml

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

composer.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,30 @@
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"
3639
}
3740
}

phpspec.yml.ci

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

phpspec.yml.dist

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

phpunit.xml

Lines changed: 26 additions & 0 deletions
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>

spec/LoggerPluginSpec.php

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

0 commit comments

Comments
 (0)