Skip to content

Commit 9bfa075

Browse files
committed
Add support for PHP 8.4
1 parent 797fe80 commit 9bfa075

File tree

3 files changed

+55
-41
lines changed

3 files changed

+55
-41
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,50 @@ name: build
33
on: [ push, pull_request ]
44

55
jobs:
6-
run:
7-
runs-on: ${{ matrix.operating-system }}
8-
strategy:
9-
matrix:
10-
operating-system: [ ubuntu-latest ]
11-
php-versions: [ '8.1', '8.2' ]
12-
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v1
17-
18-
- name: Setup PHP
19-
uses: shivammathur/setup-php@v2
20-
with:
21-
php-version: ${{ matrix.php-versions }}
22-
extensions: mbstring, intl, zip
23-
coverage: none
24-
25-
- name: Check PHP Version
26-
run: php -v
27-
28-
- name: Check Composer Version
29-
run: composer -V
30-
31-
- name: Check PHP Extensions
32-
run: php -m
33-
34-
- name: Validate composer.json and composer.lock
35-
run: composer validate
36-
37-
- name: Install dependencies
38-
run: composer install --prefer-dist --no-progress --no-suggest
39-
40-
- name: Run test suite
41-
run: composer test:all
6+
run:
7+
runs-on: ${{ matrix.operating-system }}
8+
strategy:
9+
matrix:
10+
operating-system: [ ubuntu-latest ]
11+
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
12+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v1
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extensions: mbstring, intl, zip
23+
coverage: none
24+
25+
- name: Check PHP Version
26+
run: php -v
27+
28+
- name: Check Composer Version
29+
run: composer -V
30+
31+
- name: Check PHP Extensions
32+
run: php -m
33+
34+
- name: Validate composer.json and composer.lock
35+
run: composer validate
36+
37+
- name: Install dependencies
38+
run: composer install --prefer-dist --no-progress --no-suggest
39+
40+
- name: Run PHP CodeSniffer
41+
run: composer sniffer:check
42+
43+
- name: Run PHPStan
44+
run: composer stan
45+
46+
- name: Run tests
47+
if: ${{ matrix.php-versions != '8.4' }}
48+
run: composer test
49+
50+
- name: Run tests with coverage
51+
if: ${{ matrix.php-versions == '8.4' }}
52+
run: composer test:coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A strictly typed array reader for PHP.
1212

1313
## Requirements
1414

15-
* PHP 8.1+
15+
* PHP 8.1 - 8.4
1616

1717
## Installation
1818

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
],
1414
"homepage": "https://github.com/selective-php/array-reader",
1515
"require": {
16-
"php": "^8.1",
16+
"php": "8.1.* || 8.2.* || 8.3.* || 8.4.*",
1717
"cakephp/chronos": "^2 || ^3"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3",
21-
"phpstan/phpstan": "^1",
21+
"phpstan/phpstan": "^1 || ^2",
2222
"phpunit/phpunit": "^10",
2323
"squizlabs/php_codesniffer": "^3"
2424
},
@@ -47,13 +47,16 @@
4747
"sniffer:check": "phpcs --standard=phpcs.xml",
4848
"sniffer:fix": "phpcbf --standard=phpcs.xml",
4949
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
50-
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
50+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations --no-coverage",
5151
"test:all": [
5252
"@cs:check",
5353
"@sniffer:check",
5454
"@stan",
5555
"@test"
5656
],
57-
"test:coverage": "php -d xdebug.mode=coverage -r \"require 'vendor/bin/phpunit';\" -- --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
57+
"test:coverage": [
58+
"@putenv XDEBUG_MODE=coverage",
59+
"phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations --coverage-clover build/coverage/clover.xml --coverage-html build/coverage --coverage-text"
60+
]
5861
}
5962
}

0 commit comments

Comments
 (0)