Skip to content

Commit 37094bd

Browse files
author
Renan
committed
PHP 8.3 support
1 parent 2e1f529 commit 37094bd

File tree

12 files changed

+120
-248
lines changed

12 files changed

+120
-248
lines changed

.github/workflows/coding-standards.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ jobs:
1818
steps:
1919

2020
- name: Checkout
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222

2323
- name: Setup tools
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: 7.4
27-
tools: php-cs-fixer:2, cs2pr
28-
29-
- name: Cache PHP Coding Standards
30-
uses: actions/cache@v2
31-
with:
32-
path: var/.php_cs.dist.cache
33-
key: php-cs-fixer-${{ github.sha }}
34-
restore-keys: php-cs-fixer-
26+
php-version: 8.2
27+
tools: php-cs-fixer, cs2pr
28+
coverage: none
3529

3630
- name: Run PHP Coding Standards
3731
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

.github/workflows/static-analysis.yaml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,20 @@ jobs:
1818
steps:
1919

2020
- name: Checkout
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222

2323
- name: Setup tools
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: 7.4
26+
php-version: 8.2
2727
tools: phpstan, cs2pr
28-
29-
- name: Get Composer cache directory
30-
id: composercache
31-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
32-
33-
- name: Cache Composer dependencies
34-
uses: actions/cache@v2
35-
with:
36-
path: ${{ steps.composercache.outputs.dir }}
37-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
38-
restore-keys: ${{ runner.os }}-composer-
28+
coverage: none
3929

4030
- name: Install Composer dependencies
41-
run: composer install --no-interaction --prefer-dist
31+
uses: ramsey/composer-install@v2
4232

4333
- name: Cache PHPStan
44-
uses: actions/cache@v2
34+
uses: actions/cache@v3
4535
with:
4636
path: var/phpstan/
4737
key: phpstan-${{ github.sha }}

.github/workflows/tests.yaml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,33 @@ on:
88

99
pull_request:
1010

11-
schedule:
12-
- cron: '20 16 * * SUN'
13-
1411
jobs:
1512

1613
tests:
1714

18-
name: PHPUnit (PHP ${{ matrix.php-version }}) ${{ matrix.lowest-dependencies && '(lowest deps)' || '' }}
15+
name: PHPUnit (PHP ${{ matrix.php-version }}) (${{ matrix.dependencies }} dependencies)
1916
runs-on: ubuntu-latest
2017
strategy:
2118
fail-fast: false
2219
matrix:
23-
lowest-dependencies: [true, false]
24-
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
25-
include:
26-
- php-version: '7.4'
27-
lowest-dependencies: false
28-
coverage: true
29-
env:
30-
COMPOSER_FLAGS: ${{ matrix.lowest-dependencies && '--prefer-lowest' || '' }}
20+
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
21+
dependencies: ['lowest', 'highest']
3122

3223
steps:
3324

3425
- name: Checkout
35-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
3627

3728
- name: Setup PHP
3829
uses: shivammathur/setup-php@v2
3930
with:
4031
php-version: ${{ matrix.php-version }}
41-
coverage: ${{ matrix.coverage && 'pcov' || 'none' }}
42-
43-
- name: Determine Composer cache directory
44-
id: composercache
45-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
46-
47-
- name: Load Composer cache
48-
uses: actions/cache@v2
49-
with:
50-
path: ${{ steps.composercache.outputs.dir }}
51-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
52-
restore-keys: ${{ runner.os }}-composer-
32+
coverage: none
5333

5434
- name: Install Composer dependencies
55-
run: |
56-
composer update --no-interaction --prefer-dist ${{ env.COMPOSER_FLAGS }}
57-
composer update --no-interaction --prefer-dist --with-all-dependencies phpunit/phpunit
35+
uses: ramsey/composer-install@v2
36+
with:
37+
dependency-versions: ${{ matrix.dependencies }}
5838

5939
- name: Run PHPUnit
60-
run: vendor/bin/phpunit --testdox ${{ !matrix.coverage && '--no-coverage' || '--coverage-clover coverage.xml' }}
61-
62-
- name: Upload coverage to Codecov
63-
uses: codecov/codecov-action@v1
64-
if: ${{ matrix.coverage }}
65-
with:
66-
file: ./coverage.xml
40+
run: vendor/bin/phpunit --testdox

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/.php_cs
1+
/.php-cs-fixer.php
22
/composer.lock
33
/phpstan.neon
44
/phpunit.xml

.php-cs-fixer.dist.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
return (new PhpCsFixer\Config())
4+
->setCacheFile(__DIR__ . '/var/.php_cs.cache')
5+
->setRiskyAllowed(true)
6+
->setRules([
7+
'@PER-CS' => true,
8+
'@PER-CS:risky' => true,
9+
'visibility_required' => ['elements' => ['method', 'property']], // PHP 5 compatibility
10+
])
11+
->setFinder(PhpCsFixer\Finder::create()->in([
12+
__DIR__ . '/src',
13+
__DIR__ . '/tests',
14+
]));

.php_cs.dist

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

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
</a>
1414
</p>
1515

16-
![Tests](https://github.com/renanbr/crossref-client/workflows/Tests/badge.svg)
17-
[![codecov](https://codecov.io/gh/renanbr/crossref-client/branch/master/graph/badge.svg)](https://codecov.io/gh/renanbr/crossref-client)
18-
![Static Analysis](https://github.com/renanbr/crossref-client/workflows/Static%20Analysis/badge.svg)
19-
![Coding Standards](https://github.com/renanbr/crossref-client/workflows/Coding%20Standards/badge.svg)
20-
2116
## Table of contents
2217

2318
* [Introduction](#introduction)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"guzzlehttp/guzzle": "^6.2 || ^7.4",
2727
"kevinrob/guzzle-cache-middleware": "^3.1 || ^4.0",
2828
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
29-
"rtheunissen/guzzle-rate-limiter": "^1.0 || ^2.0 || ^3.0"
29+
"rtheunissen/guzzle-rate-limiter": "^2.0 || ^3.0"
3030
},
3131
"require-dev": {
3232
"phpunit/phpunit": ">=5.7"

phpstan.dist.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src
5+
- tests

phpstan.neon.dist

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

0 commit comments

Comments
 (0)