Skip to content

Commit 09b153d

Browse files
committed
Run tests in CI also with PHP 8.3
Further reformat ci.yml with 2 indents as defined in .editorconfig, upgrade to use github actions/checkout in v4, remove deprecated option --no-suggest from composer install and some code style changes in PHP after running PHP CS Fixer in the newest version.
1 parent 3a91a1e commit 09b153d

File tree

3 files changed

+47
-60
lines changed

3 files changed

+47
-60
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,71 +3,62 @@ name: CI (tests, code style and static analysis)
33
on: pull_request
44

55
jobs:
6-
cs:
7-
name: PHP CS Fixer
8-
runs-on: ubuntu-latest
6+
cs:
7+
name: PHP CS Fixer
8+
runs-on: ubuntu-latest
99

10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v2
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
1313

14-
- name: Install PHP
15-
uses: shivammathur/setup-php@v2
16-
with:
17-
php-version: '8.0'
14+
- name: Install PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: '8.0'
1818

19-
- name: Check PHP Version
20-
run: php -v
19+
- name: Install dependencies
20+
run: composer install --prefer-dist --no-progress
2121

22-
- name: Install dependencies
23-
run: composer install --prefer-dist --no-progress --no-suggest
22+
- name: Run PHP CS Fixer
23+
run: composer cs
2424

25-
- name: Run PHP CS Fixer
26-
run: composer cs
25+
tests:
26+
name: PestPHP Tests
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
php-versions: ['8.0', '8.1', '8.2', '8.3']
2731

28-
tests:
29-
name: PestPHP Tests
30-
runs-on: ubuntu-latest
31-
strategy:
32-
matrix:
33-
php-versions: ['8.0', '8.1', '8.2']
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
3435

35-
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v2
36+
- name: Install PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php-versions }}
3840

39-
- name: Install PHP
40-
uses: shivammathur/setup-php@v2
41-
with:
42-
php-version: ${{ matrix.php-versions }}
41+
- name: Install dependencies
42+
run: composer install --prefer-dist --no-progress
4343

44-
- name: Check PHP Version
45-
run: php -v
44+
- name: Run tests
45+
run: composer test
4646

47-
- name: Install dependencies
48-
run: composer install --prefer-dist --no-progress --no-suggest
47+
stan:
48+
name: PHPStan
49+
runs-on: ubuntu-latest
4950

50-
- name: Run tests
51-
run: composer test
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v4
5254

53-
stan:
54-
name: PHPStan
55-
runs-on: ubuntu-latest
55+
- name: Install PHP
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: '8.0'
5659

57-
steps:
58-
- name: Checkout code
59-
uses: actions/checkout@v2
60+
- name: Install dependencies
61+
run: composer install --prefer-dist --no-progress
6062

61-
- name: Install PHP
62-
uses: shivammathur/setup-php@v2
63-
with:
64-
php-version: '8.0'
65-
66-
- name: Check PHP Version
67-
run: php -v
68-
69-
- name: Install dependencies
70-
run: composer install --prefer-dist --no-progress --no-suggest
71-
72-
- name: Run PHPStan
73-
run: composer stan
63+
- name: Run PHPStan
64+
run: composer stan

src/Exceptions/InvalidJsonException.php

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

55
use Exception;
66

7-
class InvalidJsonException extends Exception
8-
{
9-
}
7+
class InvalidJsonException extends Exception {}

src/Microseconds.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
class Microseconds
1515
{
16-
public function __construct(public int $value)
17-
{
18-
}
16+
public function __construct(public int $value) {}
1917

2018
public static function now(): self
2119
{

0 commit comments

Comments
 (0)