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

Public Member Functions

 __construct ($value)
 
 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 fulfilled.

Thenning off of this promise will invoke the onFulfilled callback immediately and ignore other callbacks.

Definition at line 10 of file guzzlehttp/promises/src/FulfilledPromise.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Promise\FulfilledPromise::__construct (   $value)

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

Member Function Documentation

◆ cancel()

GuzzleHttp\Promise\FulfilledPromise::cancel ( )

◆ getState()

GuzzleHttp\Promise\FulfilledPromise::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 61 of file guzzlehttp/promises/src/FulfilledPromise.php.

References GuzzleHttp\Promise\PromiseInterface\FULFILLED.

◆ otherwise()

GuzzleHttp\Promise\FulfilledPromise::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 51 of file guzzlehttp/promises/src/FulfilledPromise.php.

References GuzzleHttp\Promise\Promise\then().

◆ reject()

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

Reject the promise with the given reason.

Parameters
mixed$reason
Exceptions

Implements GuzzleHttp\Promise\PromiseInterface.

Definition at line 73 of file guzzlehttp/promises/src/FulfilledPromise.php.

◆ resolve()

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

Resolve the promise with the given value.

Parameters
mixed$value
Exceptions

Implements GuzzleHttp\Promise\PromiseInterface.

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

◆ then()

GuzzleHttp\Promise\FulfilledPromise::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/FulfilledPromise.php.

References GuzzleHttp\Promise\queue().

◆ wait()

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

Definition at line 56 of file guzzlehttp/promises/src/FulfilledPromise.php.


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