Skip to content

Commit 77c6483

Browse files
authored
Merge pull request #1 from Ticketpark/php81
Upgrade code style to PHP 8.1
2 parents 9abfb88 + 3fc40fe commit 77c6483

File tree

11 files changed

+263
-466
lines changed

11 files changed

+263
-466
lines changed

.github/workflows/tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
linux_tests:
9+
runs-on: ubuntu-20.04
10+
11+
strategy:
12+
matrix:
13+
php: ['8.1', '8.2']
14+
stability: ['prefer-lowest', 'prefer-stable']
15+
16+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
tools: composer:v2
27+
coverage: none
28+
29+
- name: Check for syntax errors in PHP files
30+
run: find ./ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l
31+
32+
- name: Check composer files
33+
run: composer validate --strict
34+
35+
- name: Install dependencies
36+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
37+
38+
- name: Execute tests
39+
run: vendor/bin/phpunit --verbose
40+
41+
- name: Check coding standard
42+
run: vendor/bin/php-cs-fixer --no-interaction --dry-run --diff -v fix lib/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
composer.lock
22
vendor
3+
/.phpunit.cache
4+
/.phpunit.result.cache
5+
/.php-cs-fixer.cache

composer.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A PHP client to use the Ticketpark API",
44
"type": "library",
55
"require": {
6-
"php": ">=5.6",
6+
"php": ">=8.1",
77
"kriswallsmith/buzz": "^0.15.0"
88
},
99
"license": "MIT",
@@ -15,6 +15,14 @@
1515
],
1616
"minimum-stability": "stable",
1717
"autoload": {
18-
"psr-4": { "Ticketpark\\ApiClient\\": "lib/ApiClient" }
18+
"psr-4": {
19+
"Ticketpark\\ApiClient\\": "lib/ApiClient",
20+
"Ticketpark\\ApiClient\\Test\\": "test/ApiClient"
21+
}
22+
},
23+
"require-dev": {
24+
"phpunit/phpunit": "^9.6",
25+
"rector/rector": "^0.18.3",
26+
"friendsofphp/php-cs-fixer": "^3.27"
1927
}
2028
}

lib/ApiClient/Exception/TokenGenerationException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class TokenGenerationException extends \Exception
66
{
7-
8-
}
7+
}

0 commit comments

Comments
 (0)