Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 support #22

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/coding-standards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,14 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup tools
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: php-cs-fixer:2, cs2pr

- name: Cache PHP Coding Standards
uses: actions/cache@v2
with:
path: var/.php_cs.dist.cache
key: php-cs-fixer-${{ github.sha }}
restore-keys: php-cs-fixer-
php-version: 8.2
tools: php-cs-fixer, cs2pr
coverage: none

- name: Run PHP Coding Standards
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
20 changes: 5 additions & 15 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,20 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup tools
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.2
tools: phpstan, cs2pr

- name: Get Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
coverage: none

- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
uses: ramsey/composer-install@v2

- name: Cache PHPStan
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: var/phpstan/
key: phpstan-${{ github.sha }}
Expand Down
44 changes: 9 additions & 35 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,33 @@ on:

pull_request:

schedule:
- cron: '20 16 * * SUN'

jobs:

tests:

name: PHPUnit (PHP ${{ matrix.php-version }}) ${{ matrix.lowest-dependencies && '(lowest deps)' || '' }}
name: PHPUnit (PHP ${{ matrix.php-version }}) (${{ matrix.dependencies }} dependencies)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lowest-dependencies: [true, false]
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
include:
- php-version: '7.4'
lowest-dependencies: false
coverage: true
env:
COMPOSER_FLAGS: ${{ matrix.lowest-dependencies && '--prefer-lowest' || '' }}
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
dependencies: ['lowest', 'highest']

steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.coverage && 'pcov' || 'none' }}

- name: Determine Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Load Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
coverage: none

- name: Install Composer dependencies
run: |
composer update --no-interaction --prefer-dist ${{ env.COMPOSER_FLAGS }}
composer update --no-interaction --prefer-dist --with-all-dependencies phpunit/phpunit
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Run PHPUnit
run: vendor/bin/phpunit --testdox ${{ !matrix.coverage && '--no-coverage' || '--coverage-clover coverage.xml' }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: ${{ matrix.coverage }}
with:
file: ./coverage.xml
run: vendor/bin/phpunit --testdox
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.php_cs
/.php-cs-fixer.php
/composer.lock
/phpstan.neon
/phpunit.xml
Expand Down
14 changes: 14 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

return (new PhpCsFixer\Config())
->setCacheFile(__DIR__ . '/var/.php_cs.cache')
->setRiskyAllowed(true)
->setRules([
'@PER-CS' => true,
'@PER-CS:risky' => true,
'visibility_required' => ['elements' => ['method', 'property']], // PHP 5 compatibility
])
->setFinder(PhpCsFixer\Finder::create()->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]));
50 changes: 0 additions & 50 deletions .php_cs.dist

This file was deleted.

5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
</a>
</p>

![Tests](https://github.com/renanbr/crossref-client/workflows/Tests/badge.svg)
[![codecov](https://codecov.io/gh/renanbr/crossref-client/branch/master/graph/badge.svg)](https://codecov.io/gh/renanbr/crossref-client)
![Static Analysis](https://github.com/renanbr/crossref-client/workflows/Static%20Analysis/badge.svg)
![Coding Standards](https://github.com/renanbr/crossref-client/workflows/Coding%20Standards/badge.svg)

## Table of contents

* [Introduction](#introduction)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"guzzlehttp/guzzle": "^6.2 || ^7.4",
"kevinrob/guzzle-cache-middleware": "^3.1 || ^4.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
"rtheunissen/guzzle-rate-limiter": "^1.0 || ^2.0 || ^3.0"
"rtheunissen/guzzle-rate-limiter": "^2.0 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.7"
Expand Down
5 changes: 5 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 5
paths:
- src
- tests
7 changes: 0 additions & 7 deletions phpstan.neon.dist

This file was deleted.

101 changes: 0 additions & 101 deletions src/CrossRefClient/AbstractRateLimitProvider.php

This file was deleted.

Loading