Skip to content

Commit 5fc90d8

Browse files
committed
Support for PHP > 8.1
1 parent 5d563b3 commit 5fc90d8

File tree

11 files changed

+177
-6764
lines changed

11 files changed

+177
-6764
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
insert_final_newline = true
8+
tab_width = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/.github export-ignore
22
/tests export-ignore
3+
/.vscode export-ignore
34
.gitignore export-ignore
45
.gitattributes export-ignore
56
.scrutinizer.yml export-ignore
7+
.editorconfig export-ignore
68
phpunit.xml.dist export-ignore
79
behat.yml export-ignore
810
composer.lock export-ignore

.github/workflows/behat.yml

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

.github/workflows/ci.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
static:
7+
name: Psalm
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Psalm
14+
uses: docker://vimeo/psalm-github-actions
15+
with:
16+
security_analysis: true
17+
report_file: results.sarif
18+
composer_ignore_platform_reqs: true
19+
20+
- name: Upload Security Analysis results to GitHub
21+
uses: github/codeql-action/upload-sarif@v2
22+
with:
23+
sarif_file: results.sarif
24+
25+
# we may use whatever way to install phpcs, just specify the path on the next step
26+
# however, curl seems to be the fastest
27+
- name: Install PHP_CodeSniffer
28+
run: |
29+
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
30+
php phpcs.phar --version
31+
32+
- uses: tinovyatkin/action-php-codesniffer@v1
33+
with:
34+
files: "**.php" # you may customize glob as needed
35+
phpcs_path: php phpcs.phar
36+
standard: phpcs.xml
37+
38+
unittest:
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
matrix:
43+
php:
44+
- version: 7.4
45+
coverage: false
46+
- version: 8.0
47+
coverage: false
48+
- version: 8.1
49+
coverage: false
50+
- version: 8.2
51+
coverage: false
52+
- version: 8.3
53+
coverage: true
54+
- version: 8.4
55+
coverage: false
56+
prefer-lowest: ['', '--prefer-lowest']
57+
58+
name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Install PHP
64+
uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: ${{ matrix.php.version }}
67+
extensions: mbstring
68+
69+
- name: Validate composer.json and composer.lock
70+
run: composer validate --strict
71+
72+
- name: Cache Composer packages
73+
id: composer-cache
74+
uses: actions/cache@v4
75+
with:
76+
path: vendor
77+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
78+
restore-keys: |
79+
${{ runner.os }}-php-
80+
81+
- name: Update dependencies
82+
run: composer update --prefer-dist --no-progress --with-all-dependencies ${{ matrix.prefer-lowest }}
83+
84+
- name: Run test suite
85+
if: ${{ ! matrix.php.coverage }}
86+
run: ./vendor/bin/phpunit
87+
88+
- name: Run test suite with code coverage
89+
if: ${{ matrix.php.coverage }}
90+
run: ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
91+
env:
92+
XDEBUG_MODE: coverage
93+
94+
- name: Upload code coverage to Scrutinizer
95+
if: ${{ matrix.php.coverage }}
96+
run: |
97+
wget -q https://scrutinizer-ci.com/ocular.phar
98+
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml || true
99+
100+
integrationtest:
101+
runs-on: ubuntu-latest
102+
103+
name: Behat
104+
105+
steps:
106+
- uses: actions/checkout@v4
107+
108+
- name: Install PHP
109+
uses: shivammathur/setup-php@v2
110+
with:
111+
php-version: 8.4
112+
113+
- name: Cache Composer packages
114+
id: composer-cache
115+
uses: actions/cache@v4
116+
with:
117+
path: vendor
118+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
119+
restore-keys: |
120+
${{ runner.os }}-php-
121+
122+
- name: Install dependencies
123+
run: composer install --prefer-dist --no-progress
124+
125+
- name: Run test suite
126+
run: ./vendor/bin/behat

.github/workflows/static.yml

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

.github/workflows/unit.yml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.phpunit.result.cache
55
.phpcs-cache
66
phpunit.xml
7+
composer.lock

.scrutinizer.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
imports:
2-
- php
2+
- php
33

44
build:
5-
environment:
6-
php: 8.0.0
7-
nodes:
8-
analysis:
9-
project_setup:
10-
override:
11-
- 'true'
12-
tests:
13-
override:
14-
- php-scrutinizer-run
15-
-
16-
command: phpcs-run
5+
environment:
6+
php: 8.0.0
7+
nodes:
8+
analysis:
9+
project_setup:
10+
override:
11+
- "true"
12+
tests:
13+
override:
14+
- php-scrutinizer-run
15+
- command: phpcs-run
1716

1817
filter:
19-
excluded_paths:
20-
- 'tests/*'
21-
- 'bin/*'
18+
excluded_paths:
19+
- "tests/*"
20+
- "bin/*"
2221

2322
checks:
24-
php: true
23+
php: true
2524

2625
coding_style:
27-
php:
28-
spaces:
29-
around_operators:
30-
concatenation: true
26+
php:
27+
spaces:
28+
around_operators:
29+
concatenation: true
3130

3231
tools:
33-
php_cs_fixer: false
34-
external_code_coverage:
35-
timeout: 300
32+
php_cs_fixer: false
33+
external_code_coverage:
34+
timeout: 300

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,24 @@
2323
},
2424
"minimum-stability": "stable",
2525
"require": {
26-
"php": "^7.4 || ~8.0.0 || ~8.1.0",
26+
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
2727
"doctrine/common": "^3.0",
2828
"doctrine/orm": "^2.5",
2929
"doctrine/persistence": "^3.0",
3030
"laminas/laminas-hydrator": "^3.0 || ^4.0",
3131
"laminas/laminas-stdlib": "^3.0"
3232
},
3333
"require-dev": {
34-
"behat/behat": "^3.8",
35-
"dms/phpunit-arraysubset-asserts": "^0.4.0",
36-
"phpspec/prophecy-phpunit": "^2.0",
37-
"phpunit/php-invoker": "^3.1",
38-
"phpunit/phpunit": "^9.5",
34+
"behat/behat": ">=3.8",
35+
"dms/phpunit-arraysubset-asserts": ">=0.4.0",
36+
"phpspec/prophecy-phpunit": ">=2.0",
37+
"phpunit/php-invoker": ">=3.1",
38+
"phpunit/phpunit": ">=9.6.21",
39+
"webmozart/assert": ">=1.11.0",
3940
"symfony/cache": "^5.4 || ^6.0",
4041
"doctrine/annotations": "^1.13",
41-
"laminas/laminas-coding-standard": "^2.3",
42-
"vimeo/psalm": "^4.23"
42+
"laminas/laminas-coding-standard": ">=2.3",
43+
"vimeo/psalm": ">=4.23"
4344
},
4445
"config": {
4546
"sort-packages": true,

0 commit comments

Comments
 (0)