public function PromiseInterface::otherwise in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/promises/src/PromiseInterface.php \GuzzleHttp\Promise\PromiseInterface::otherwise()
Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
Parameters
callable $onRejected Invoked when the promise is rejected.:
Return value
4 methods override PromiseInterface::otherwise()
- FulfilledPromise::otherwise in vendor/
guzzlehttp/ promises/ src/ FulfilledPromise.php - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
- NotPromiseInstance::otherwise in vendor/
guzzlehttp/ promises/ tests/ NotPromiseInstance.php - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
- Promise::otherwise in vendor/
guzzlehttp/ promises/ src/ Promise.php - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
- RejectedPromise::otherwise in vendor/
guzzlehttp/ promises/ src/ RejectedPromise.php - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
File
- vendor/
guzzlehttp/ promises/ src/ PromiseInterface.php, line 43
Class
- PromiseInterface
- A promise represents the eventual result of an asynchronous operation.
Namespace
GuzzleHttp\PromiseCode
public function otherwise(callable $onRejected);