You are here

function rejection_for in Auth0 Single Sign On 8.2

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.:

Return value

PromiseInterface

1 call to rejection_for()
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/functions.php, line 92

Namespace

GuzzleHttp\Promise

Code

function rejection_for($reason) {
  if ($reason instanceof PromiseInterface) {
    return $reason;
  }
  return new RejectedPromise($reason);
}