Skip to content

Commit 6a8ce7d

Browse files
author
Greg Bowler
committed
ci: php 8.4 compatibility
1 parent 7719f97 commit 6a8ce7d

File tree

4 files changed

+29
-16
lines changed

4 files changed

+29
-16
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: [ 8.1, 8.2, 8.3 ]
10+
php: [ 8.1, 8.2, 8.3, 8.4 ]
1111

1212
steps:
1313
- uses: actions/checkout@v4
1414

1515
- name: Cache Composer dependencies
16-
uses: actions/cache@v3
16+
uses: actions/cache@v4
1717
with:
1818
path: /tmp/composer-cache
1919
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
@@ -37,7 +37,7 @@ jobs:
3737
needs: [ composer ]
3838
strategy:
3939
matrix:
40-
php: [ 8.1, 8.2, 8.3 ]
40+
php: [ 8.1, 8.2, 8.3, 8.4 ]
4141

4242
outputs:
4343
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
@@ -52,11 +52,10 @@ jobs:
5252
run: tar -xvf /tmp/github-actions/build.tar ./
5353

5454
- name: PHP Unit tests
55-
uses: php-actions/phpunit@master
55+
uses: php-actions/phpunit@v4
5656
env:
5757
XDEBUG_MODE: cover
5858
with:
59-
version: 10
6059
php_version: ${{ matrix.php }}
6160
php_extensions: xdebug
6261
coverage_text: _coverage/coverage.txt
@@ -73,9 +72,11 @@ jobs:
7372
needs: [ phpunit ]
7473
strategy:
7574
matrix:
76-
php: [ 8.1, 8.2, 8.3 ]
75+
php: [ 8.1, 8.2, 8.3, 8.4 ]
7776

7877
steps:
78+
- uses: actions/checkout@v4
79+
7980
- uses: actions/download-artifact@v4
8081
with:
8182
name: code-coverage-${{ matrix.php }}-${{ github.run_number }}
@@ -85,16 +86,14 @@ jobs:
8586
run: cat "_coverage/coverage.txt"
8687

8788
- name: Upload to Codecov
88-
uses: codecov/codecov-action@v4
89-
with:
90-
token: ${{ secrets.CODECOV_TOKEN }}
89+
uses: codecov/codecov-action@v5
9190

9291
phpstan:
9392
runs-on: ubuntu-latest
9493
needs: [ composer ]
9594
strategy:
9695
matrix:
97-
php: [ 8.1, 8.2, 8.3 ]
96+
php: [ 8.1, 8.2, 8.3, 8.4 ]
9897

9998
steps:
10099
- uses: actions/download-artifact@v4
@@ -110,14 +109,13 @@ jobs:
110109
with:
111110
php_version: ${{ matrix.php }}
112111
path: src/
113-
level: 6
114112

115113
phpmd:
116114
runs-on: ubuntu-latest
117115
needs: [ composer ]
118116
strategy:
119117
matrix:
120-
php: [ 8.1, 8.2, 8.3 ]
118+
php: [ 8.1, 8.2, 8.3, 8.4 ]
121119

122120
steps:
123121
- uses: actions/download-artifact@v4
@@ -141,7 +139,7 @@ jobs:
141139
needs: [ composer ]
142140
strategy:
143141
matrix:
144-
php: [ 8.1, 8.2, 8.3 ]
142+
php: [ 8.1, 8.2, 8.3, 8.4 ]
145143

146144
steps:
147145
- uses: actions/download-artifact@v4
@@ -158,3 +156,18 @@ jobs:
158156
php_version: ${{ matrix.php }}
159157
path: src/
160158
standard: phpcs.xml
159+
160+
remove_old_artifacts:
161+
runs-on: ubuntu-latest
162+
163+
steps:
164+
- name: Remove old artifacts for prior workflow runs on this repository
165+
env:
166+
GH_TOKEN: ${{ github.token }}
167+
run: |
168+
gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
169+
while read id
170+
do
171+
echo -n "Deleting artifact ID $id ... "
172+
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
173+
done <artifact-id-list.txt

src/Deferred.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Deferred implements DeferredInterface {
1717
private array $deferredCompleteCallback;
1818
private bool $activated;
1919

20-
public function __construct(callable $process = null) {
20+
public function __construct(?callable $process = null) {
2121
$this->promise = new Promise(function($resolve, $reject, $complete):void {
2222
$this->resolveCallback = $resolve;
2323
$this->rejectCallback = $reject;

src/DeferredInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Throwable;
55

66
interface DeferredInterface {
7-
public function __construct(callable $process = null);
7+
public function __construct(?callable $process = null);
88

99
/**
1010
* Returns the instance of the Promise that will be resolved/rejected

src/PromiseResolvedWithAnotherPromiseException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PromiseResolvedWithAnotherPromiseException extends PromiseException {
99
public function __construct(
1010
string $message = "",
1111
int $code = 0,
12-
Throwable $previous = null
12+
?Throwable $previous = null
1313
) {
1414
parent::__construct(
1515
$message ?: self::DEFAULT_MESSAGE,

0 commit comments

Comments
 (0)