Skip to content

Conversation

@tifabien
Copy link

I'm using PHPStan to check my code.
When I'm using chaining method calls with Promise->then(...)->otherwise(...), PHPStan is complaining about the fact that otherwise method is undefined in PromiseInterface.
I can break my chaining method calls and use the PHPDoc comment but it's not very sexy...

/** @var ExtendedPromiseInterface $promise */
$promise = $this->session->call(...)->then(...);
$promise->otherwise(...);

By adding the PHPDoc it fixes this warning and I can continue to use chaining method calls.

@jsor
Copy link
Member

jsor commented May 9, 2019

Thanks for your PR. Unfortunately, this would be a BC break, see #139 for a discussion around this.

@jsor jsor closed this May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants