PHP Interface Kraken\Promise\PromiseInterface

Inheritance: extends Kraken\Promise\DeferredInterface
Afficher le fichier Open project: kraken-php/framework Interface Usage Examples

Méthodes publiques

Méthode Description
abort ( callable $onCancel ) : Kraken\Promise\PromiseInterface Transform Promise's value by applying a function to the Promise's cancellation value. Returns a new promise for the transformed result.
always ( callable $onFulfilledOrRejected ) : Kraken\Promise\PromiseInterface Apply cleanup handler that fires regardless of Promise resolution state and suppress return value.
done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : null Consume the Promise's ultimate value if the promise fulfills or handle the ultimate error and cancellation.
failure ( callable $onFailure ) : Kraken\Promise\PromiseInterface Transform Promise's value by applying a function to the Promise's rejection value. Returns a new promise for the transformed result.
isCancelled ( ) : boolean Check if Promise is cancelled.
isFulfilled ( ) : boolean Check if Promise is fulfilled.
isPending ( ) : boolean Check if Promise is still pending.
isRejected ( ) : boolean Check if Promise is rejected.
spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : Kraken\Promise\PromiseInterface Apply then transformation callbacks that automatically spreads received array into separate arguments.
success ( callable $onSuccess ) : Kraken\Promise\PromiseInterface Transform Promise's value by applying a function to the Promise's fulfillment value. Returns a new promise for the transformed result.
then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : Kraken\Promise\PromiseInterface Transform Promise's value by applying a function to the Promise's fulfillment, rejection or cancellation value.

Method Details

abort() public méthode

Transform Promise's value by applying a function to the Promise's cancellation value. Returns a new promise for the transformed result.
See also: PromiseInterface::then
public abort ( callable $onCancel ) : Kraken\Promise\PromiseInterface
$onCancel callable
Résultat Kraken\Promise\PromiseInterface

always() public méthode

Apply cleanup handler that fires regardless of Promise resolution state and suppress return value.
See also: PromiseInterface::then
public always ( callable $onFulfilledOrRejected ) : Kraken\Promise\PromiseInterface
$onFulfilledOrRejected callable
Résultat Kraken\Promise\PromiseInterface

done() public méthode

Returns null.
public done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : null
$onFulfilled callable
$onRejected callable
$onCancel callable
Résultat null

failure() public méthode

Transform Promise's value by applying a function to the Promise's rejection value. Returns a new promise for the transformed result.
See also: PromiseInterface::then
public failure ( callable $onFailure ) : Kraken\Promise\PromiseInterface
$onFailure callable
Résultat Kraken\Promise\PromiseInterface

isCancelled() public méthode

Check if Promise is cancelled.
public isCancelled ( ) : boolean
Résultat boolean

isFulfilled() public méthode

Check if Promise is fulfilled.
public isFulfilled ( ) : boolean
Résultat boolean

isPending() public méthode

Check if Promise is still pending.
public isPending ( ) : boolean
Résultat boolean

isRejected() public méthode

Check if Promise is rejected.
public isRejected ( ) : boolean
Résultat boolean

spread() public méthode

Returns a new promise for the transformed result.
See also: PromiseInterface::then
public spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : Kraken\Promise\PromiseInterface
$onFulfilled callable
$onRejected callable
$onCancel callable
Résultat Kraken\Promise\PromiseInterface

success() public méthode

Transform Promise's value by applying a function to the Promise's fulfillment value. Returns a new promise for the transformed result.
See also: PromiseInterface::then
public success ( callable $onSuccess ) : Kraken\Promise\PromiseInterface
$onSuccess callable
Résultat Kraken\Promise\PromiseInterface

then() public méthode

Returns a new promise for the transformed result.
public then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : Kraken\Promise\PromiseInterface
$onFulfilled callable
$onRejected callable
$onCancel callable
Résultat Kraken\Promise\PromiseInterface