function Create::rejectionFor
Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.
Parameters
mixed $reason Promise or reason.:
1 call to Create::rejectionFor()
- Promise::then in vendor/
guzzlehttp/ promises/ src/ Promise.php - Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
File
-
vendor/
guzzlehttp/ promises/ src/ Create.php, line 39
Class
Namespace
GuzzleHttp\PromiseCode
public static function rejectionFor($reason) : PromiseInterface {
if ($reason instanceof PromiseInterface) {
return $reason;
}
return new RejectedPromise($reason);
}