From ce63f42319e189cd4869770f798af7c79587c621 Mon Sep 17 00:00:00 2001 From: Paul Rotmann Date: Tue, 25 Mar 2025 09:34:45 +0100 Subject: [PATCH] Run tests on PHP 8.4 and update test environment --- .github/workflows/ci.yml | 6 ++++-- composer.json | 4 ++-- tests/types/parallel.php | 4 +++- tests/types/series.php | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a398ff9..7012617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -34,10 +35,11 @@ jobs: 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 diff --git a/composer.json b/composer.json index 103048c..ad557f2 100644 --- a/composer.json +++ b/composer.json @@ -28,10 +28,10 @@ "require": { "php": ">=7.1", "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.8 || ^1.2.1" + "react/promise": "^3.2 || ^2.8 || ^1.2.1" }, "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpstan/phpstan": "1.12.19 || 1.4.10", "phpunit/phpunit": "^9.6 || ^8.5 || ^7.5" }, "autoload": { diff --git a/tests/types/parallel.php b/tests/types/parallel.php index 02eae2f..550f1dd 100644 --- a/tests/types/parallel.php +++ b/tests/types/parallel.php @@ -6,7 +6,9 @@ use function React\Async\parallel; use function React\Promise\resolve; -assertType('React\Promise\PromiseInterface', parallel([])); +/** @var array $emptyArray */ +$emptyArray = []; +assertType('React\Promise\PromiseInterface', parallel($emptyArray)); assertType('React\Promise\PromiseInterface>', parallel([ static function (): PromiseInterface { return resolve(true); }, diff --git a/tests/types/series.php b/tests/types/series.php index aa68223..7c74b56 100644 --- a/tests/types/series.php +++ b/tests/types/series.php @@ -6,7 +6,9 @@ use function React\Async\series; use function React\Promise\resolve; -assertType('React\Promise\PromiseInterface', series([])); +/** @var array $emptyArray */ +$emptyArray = []; +assertType('React\Promise\PromiseInterface', series($emptyArray)); assertType('React\Promise\PromiseInterface>', series([ static function (): PromiseInterface { return resolve(true); },