Skip to content

Commit c54ae14

Browse files
committed
Update PHPStan
1 parent 5f80055 commit c54ae14

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php": ">=7.1.0"
2929
},
3030
"require-dev": {
31-
"phpstan/phpstan": "1.10.39 || 1.4.10",
31+
"phpstan/phpstan": "1.12.19 || 1.4.10",
3232
"phpunit/phpunit": "^9.6 || ^7.5"
3333
},
3434
"autoload": {

src/Internal/FulfilledPromise.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ public function catch(callable $onRejected): PromiseInterface
5656
return $this;
5757
}
5858

59+
/**
60+
* @param callable(): (void|PromiseInterface<void>) $onFulfilledOrRejected
61+
* @return PromiseInterface<T>
62+
*/
5963
public function finally(callable $onFulfilledOrRejected): PromiseInterface
6064
{
6165
return $this->then(function ($value) use ($onFulfilledOrRejected): PromiseInterface {
66+
/** @var T $value */
6267
return resolve($onFulfilledOrRejected())->then(function () use ($value) {
6368
return $value;
6469
});

src/Promise.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,14 @@ public function catch(callable $onRejected): PromiseInterface
9494
});
9595
}
9696

97+
/**
98+
* @param callable(): (void|PromiseInterface<void>) $onFulfilledOrRejected
99+
* @return PromiseInterface<T>
100+
*/
97101
public function finally(callable $onFulfilledOrRejected): PromiseInterface
98102
{
99103
return $this->then(static function ($value) use ($onFulfilledOrRejected): PromiseInterface {
104+
/** @var T $value */
100105
return resolve($onFulfilledOrRejected())->then(function () use ($value) {
101106
return $value;
102107
});

0 commit comments

Comments
 (0)