Open Journal Systems  3.3.0
GuzzleHttp\Promise\RejectedPromise Class Reference
Inheritance diagram for GuzzleHttp\Promise\RejectedPromise:
GuzzleHttp\Promise\PromiseInterface

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)
 
- Public Member Functions inherited from GuzzleHttp\Promise\PromiseInterface
 wait ($unwrap=true)
 

Additional Inherited Members

- Data Fields inherited from GuzzleHttp\Promise\PromiseInterface
const FULFILLED = 'fulfilled'
 
const PENDING = 'pending'
 
const REJECTED = 'rejected'
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Promise\RejectedPromise::__construct (   $reason)

Definition at line 14 of file guzzlehttp/promises/src/RejectedPromise.php.

Member Function Documentation

◆ cancel()

GuzzleHttp\Promise\RejectedPromise::cancel ( )

◆ getState()

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.

Returns
string

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 66 of file guzzlehttp/promises/src/RejectedPromise.php.

References GuzzleHttp\Promise\PromiseInterface\REJECTED.

◆ otherwise()

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.

Parameters
callable$onRejectedInvoked when the promise is rejected.
Returns
PromiseInterface

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 54 of file guzzlehttp/promises/src/RejectedPromise.php.

References GuzzleHttp\Promise\Promise\then().

◆ reject()

GuzzleHttp\Promise\RejectedPromise::reject (   $reason)

Reject the promise with the given reason.

Parameters
mixed$reason
Exceptions

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 76 of file guzzlehttp/promises/src/RejectedPromise.php.

◆ resolve()

GuzzleHttp\Promise\RejectedPromise::resolve (   $value)

Resolve the promise with the given value.

Parameters
mixed$value
Exceptions

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 71 of file guzzlehttp/promises/src/RejectedPromise.php.

◆ then()

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.

Parameters
callable$onFulfilledInvoked when the promise fulfills.
callable$onRejectedInvoked when the promise is rejected.
Returns
PromiseInterface

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 24 of file guzzlehttp/promises/src/RejectedPromise.php.

References GuzzleHttp\Promise\queue().

◆ wait()

GuzzleHttp\Promise\RejectedPromise::wait (   $unwrap = true,
  $defaultDelivery = null 
)

The documentation for this class was generated from the following file: