Promises v3 Checklist
Per https://github.com/reactphp/promise/releases/tag/v3.0.0
Irrelevant:
- [x] Existing instances of FulfilledPromise and RejectedPromise classes must be updated to use resolve() and reject() functions instead
- [x] Existing instances of LazyPromise should be removed
- [x] Any instances of some(), map(), and reduce() functions must be replaced with the any() or all() functions (I don't think we use these)
Breaking changes:
- [x] #1150 - Instances of existing code explicitly typecasting ExtendedPromiseInterface should be removed.
- [x] #1151 - Instances of existing code need to call resolve or reject and handle errors appropriately.
- [x] #1152 - Instances of existing code need to be replaced with then and resolved.
Non-breaking changes:
- [x] otherwise() and always() are deprecated, replaced by catch() and finally() (only instance I could find was Discord.php)
All this should be in https://github.com/discord-php/DiscordPHP/tree/promise-v3 now
ExtendedPromiseInterface extends PromiseInterface, and Promise v2 implements ExtendedPromiseInterface, so instead of replacing the existing typehinting to PromiseInterface we could just use React\Promise\Promise, which would overcome the hurdle and be better for futureproofing code. This seems to be the ReactPHP developers' intent as well, given they have made all classes final to encourage composition.
It's painful to read this @valzargaming :) Code-ify more please.
It's painful to read this @valzargaming :) Code-ify more please.
This is already coded in the promises v3 branch as of today.