promise
promise copied to clipboard
ExtendedPromiseInterface: type-hint for then()
This solves the problem that a PHP IDE always believes your then() method returns a PromiseInterface and not an ExtendedPromiseInterface
@Thomas-Gelf thanks for looking into this :+1:
It's not 100% guaranteed that this will always return a ExtendedPromiseInterface. I discussed this with @clue and maybe there should be something like @return PromiseInterface || ExtendedPromiseInterface
inside the docblock of the then()
method inside PromiseInterface
.
This should lead to the same results as your addition.
What do you think about this?