Skip to content

Commit

Permalink
Merge pull request #1 from Ticketpark/php81
Browse files Browse the repository at this point in the history
Upgrade code style to PHP 8.1
  • Loading branch information
sprain authored Sep 20, 2023
2 parents 9abfb88 + 3fc40fe commit 77c6483
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 466 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: tests

on:
push:
pull_request:

jobs:
linux_tests:
runs-on: ubuntu-20.04

strategy:
matrix:
php: ['8.1', '8.2']
stability: ['prefer-lowest', 'prefer-stable']

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Check for syntax errors in PHP files
run: find ./ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l

- name: Check composer files
run: composer validate --strict

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --verbose

- name: Check coding standard
run: vendor/bin/php-cs-fixer --no-interaction --dry-run --diff -v fix lib/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
composer.lock
vendor
/.phpunit.cache
/.phpunit.result.cache
/.php-cs-fixer.cache
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A PHP client to use the Ticketpark API",
"type": "library",
"require": {
"php": ">=5.6",
"php": ">=8.1",
"kriswallsmith/buzz": "^0.15.0"
},
"license": "MIT",
Expand All @@ -15,6 +15,14 @@
],
"minimum-stability": "stable",
"autoload": {
"psr-4": { "Ticketpark\\ApiClient\\": "lib/ApiClient" }
"psr-4": {
"Ticketpark\\ApiClient\\": "lib/ApiClient",
"Ticketpark\\ApiClient\\Test\\": "test/ApiClient"
}
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"rector/rector": "^0.18.3",
"friendsofphp/php-cs-fixer": "^3.27"
}
}
3 changes: 1 addition & 2 deletions lib/ApiClient/Exception/TokenGenerationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class TokenGenerationException extends \Exception
{

}
}
Loading

0 comments on commit 77c6483

Please sign in to comment.