Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($reason) | |
cancel () | |
getState () | |
otherwise (callable $onRejected) | |
reject ($reason) | |
resolve ($value) | |
then (callable $onFulfilled=null, callable $onRejected=null) | |
wait ($unwrap=true, $defaultDelivery=null) | |
![]() | |
wait ($unwrap=true) | |
Additional Inherited Members | |
![]() | |
const | FULFILLED = 'fulfilled' |
const | PENDING = 'pending' |
const | REJECTED = 'rejected' |
A promise that has been rejected.
Thenning off of this promise will invoke the onRejected callback immediately and ignore other callbacks.
Definition at line 10 of file guzzlehttp/promises/src/RejectedPromise.php.
GuzzleHttp\Promise\RejectedPromise::__construct | ( | $reason | ) |
Definition at line 14 of file guzzlehttp/promises/src/RejectedPromise.php.
GuzzleHttp\Promise\RejectedPromise::cancel | ( | ) |
Cancels the promise if possible.
https://github.com/promises-aplus/cancellation-spec/issues/7
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 83 of file guzzlehttp/promises/src/RejectedPromise.php.
GuzzleHttp\Promise\RejectedPromise::getState | ( | ) |
Get the state of the promise ("pending", "rejected", or "fulfilled").
The three states can be checked against the constants defined on PromiseInterface: PENDING, FULFILLED, and REJECTED.
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 66 of file guzzlehttp/promises/src/RejectedPromise.php.
References GuzzleHttp\Promise\PromiseInterface\REJECTED.
GuzzleHttp\Promise\RejectedPromise::otherwise | ( | callable | $onRejected | ) |
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.
callable | $onRejected | Invoked when the promise is rejected. |
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 54 of file guzzlehttp/promises/src/RejectedPromise.php.
References GuzzleHttp\Promise\Promise\then().
GuzzleHttp\Promise\RejectedPromise::reject | ( | $reason | ) |
Reject the promise with the given reason.
mixed | $reason |
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 76 of file guzzlehttp/promises/src/RejectedPromise.php.
GuzzleHttp\Promise\RejectedPromise::resolve | ( | $value | ) |
Resolve the promise with the given value.
mixed | $value |
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 71 of file guzzlehttp/promises/src/RejectedPromise.php.
GuzzleHttp\Promise\RejectedPromise::then | ( | callable | $onFulfilled = null , |
callable | $onRejected = null |
||
) |
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
callable | $onFulfilled | Invoked when the promise fulfills. |
callable | $onRejected | Invoked when the promise is rejected. |
Implements GuzzleHttp\Promise\PromiseInterface.
Definition at line 24 of file guzzlehttp/promises/src/RejectedPromise.php.
References GuzzleHttp\Promise\queue().
GuzzleHttp\Promise\RejectedPromise::wait | ( | $unwrap = true , |
|
$defaultDelivery = null |
|||
) |
Definition at line 59 of file guzzlehttp/promises/src/RejectedPromise.php.
References GuzzleHttp\Promise\exception_for().