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

resolve() cannot omit the value. #76

Open
shtse8 opened this issue Aug 10, 2017 · 3 comments
Open

resolve() cannot omit the value. #76

shtse8 opened this issue Aug 10, 2017 · 3 comments

Comments

@shtse8
Copy link

shtse8 commented Aug 10, 2017

the thenable cannot omit the value for resolve().

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function GuzzleHttp\Promise\Promise::resolve(), 0 passed

but it's very useful for just resolve the promise without returning the value.
For ReactPHP and nodejs, we can omit the resolve value and just resolve the promise directly.

@kelunik
Copy link

kelunik commented Aug 15, 2017

You could just explicitly resolve it with null, not too much of an issue, no?

@shtse8
Copy link
Author

shtse8 commented Aug 15, 2017

yes, but I have to input null for that argument. but its common for other Promise makers design that just resolving with null by default. In most cases, we just want to resolve the promise as the job is completed. but no value needs to be returned.

@Tobion
Copy link
Member

Tobion commented Oct 2, 2017

Chaning this requires an interface change (PromiseInterface) and a BC break. So it need to wait until the next major version.

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

No branches or pull requests

3 participants