-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Description
Hi,
Since the recent v1.8.0
release I am having some problems with Psalm.
There is an example listed in the README of this project:
Or if you're using react/promise v2.2.0 or up:
React\Promise\Timer\timeout($promise, 10.0)
->then(function ($value) {
// the operation finished within 10.0 seconds
})
->otherwise(function (React\Promise\Timer\TimeoutException $error) {
// the operation has failed due to a timeout
})
->otherwise(function ($error) {
// the input operation has failed due to some other error
})
;
However when running Psalm with errorLevel 5 or lower I get:
ERROR: UndefinedInterfaceMethod - Method React\Promise\PromiseInterface::otherwise does not exist (see https://psalm.dev/181)
->otherwise(function (\React\Promise\Timer\TimeoutException $error) {
I guess this is caused by the return type hint of PromiseInterface
that was added to \React\Promise\Timer\timeout
.
This timeout()
function is returning a new Promise()
, would it be an idea to change the docblock to @return Promise
or @return ExtendedPromiseInterface
?
Mattie112