Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtendedPromiseInterface: type-hint for then() #202

Closed

Conversation

Thomas-Gelf
Copy link

This solves the problem that a PHP IDE always believes your then()
method returns a PromiseInterface and not an ExtendedPromiseInterface

This solves the problem that a PHP IDE always believes your then()
method returns a PromiseInterface and not an ExtendedPromiseInterface
@SimonFrings
Copy link
Member

@Thomas-Gelf thanks for looking into this 👍

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?

@SimonFrings
Copy link
Member

This pull request here shouldn't be needed anymore with Promise v3 out, as we added template types and improved type safety in general in #246, #247 and others. The functionality of the ExtendedPromiseInterface is now part of PromiseInterface and has been removed in #75.

This is why I'll go ahead and close this ticket here, thanks for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants