/** * This method is used to set the callback when the promise is resolved. */publicfunctionthen(callable $callback):Promise;/** * This method is used to set the callback when the promise is rejected. */publicfunctioncatch(callable $callback):Promise;/** * This method is used to set the callback when the promise is resolved or rejected. */publicfunctionfinally(callable $callback):Promise;
The then() method will help you create that promise callback when it has been fulfilled.
The catch() method will generate a callback for that promise when it is rejected.
finally() is the method used to set that callback when it's complete.