diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a398ff9..d7761a8 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 @@ -20,7 +21,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -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 @@ -46,7 +48,7 @@ jobs: - 7.3 - 7.2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} diff --git a/composer.json b/composer.json index 5d1e277..6bf687d 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php": ">=7.1.0" }, "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpstan/phpstan": "1.12.28 || 1.4.10", "phpunit/phpunit": "^9.6 || ^7.5" }, "autoload": { diff --git a/src/Internal/FulfilledPromise.php b/src/Internal/FulfilledPromise.php index 8664ffd..8a66cff 100644 --- a/src/Internal/FulfilledPromise.php +++ b/src/Internal/FulfilledPromise.php @@ -59,6 +59,7 @@ public function catch(callable $onRejected): PromiseInterface public function finally(callable $onFulfilledOrRejected): PromiseInterface { return $this->then(function ($value) use ($onFulfilledOrRejected): PromiseInterface { + /** @var T $value */ return resolve($onFulfilledOrRejected())->then(function () use ($value) { return $value; }); diff --git a/src/Promise.php b/src/Promise.php index 4ac2700..0828674 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -97,6 +97,7 @@ public function catch(callable $onRejected): PromiseInterface public function finally(callable $onFulfilledOrRejected): PromiseInterface { return $this->then(static function ($value) use ($onFulfilledOrRejected): PromiseInterface { + /** @var T $value */ return resolve($onFulfilledOrRejected())->then(function () use ($value) { return $value; }); diff --git a/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt b/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt index 14b5c7c..3406968 100644 --- a/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt +++ b/tests/FunctionSetRejectionHandlerThatTriggersDefaultHandlerShouldTerminateProgramForUnhandled.phpt @@ -1,5 +1,7 @@ --TEST-- The callback given to set_rejection_handler() may trigger a fatal error for unhandled rejection +--SKIPIF-- += 80400) die("Skipped: PHP < 8.4 only."); ?> --INI-- # suppress legacy PHPUnit 7 warning for Xdebug 3 xdebug.default_enable=