Skip to content

Run tests on PHP 8.4 and update test environment + PCOV to avoid segfault with Xdebug 3.4.2 #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
jobs:
PHPUnit:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
php:
- 8.4
- 8.3
- 8.2
- 8.1
Expand All @@ -19,17 +20,18 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }}
ini-file: development
- run: composer install
- run: vendor/bin/phpunit --coverage-text

PHPStan:
name: PHPStan (PHP ${{ matrix.php }})
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
php:
- 8.4
- 8.3
- 8.2
- 8.1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react/promise": "^3.2 || ^2.8 || ^1.2.1"
},
"require-dev": {
"phpstan/phpstan": "1.10.39",
"phpstan/phpstan": "1.12.19",
"phpunit/phpunit": "^9.6"
},
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion tests/types/parallel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use function React\Async\parallel;
use function React\Promise\resolve;

assertType('React\Promise\PromiseInterface<array>', parallel([]));
/** @var array<callable():mixed> $emptyArray */
$emptyArray = [];
assertType('React\Promise\PromiseInterface<array>', parallel($emptyArray));
Comment on lines +9 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When did this become an issue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To establish PHP 8.4 compatibility, PHPStan needed to be updated to version 1.12.19. The newer PHPStan version has stricter type inference and cannot properly infer types for empty arrays, requiring explicit type annotations in the test files.


assertType('React\Promise\PromiseInterface<array<bool|float|int>>', parallel([
static fn (): PromiseInterface => resolve(true),
Expand Down
4 changes: 3 additions & 1 deletion tests/types/series.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use function React\Async\series;
use function React\Promise\resolve;

assertType('React\Promise\PromiseInterface<array>', series([]));
/** @var array<callable():mixed> $emptyArray */
$emptyArray = [];
assertType('React\Promise\PromiseInterface<array>', series($emptyArray));
Comment on lines +9 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as for tests/types/parallel.php.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.


assertType('React\Promise\PromiseInterface<array<bool|float|int>>', series([
static fn (): PromiseInterface => resolve(true),
Expand Down