PHP Интерфейс Kraken\Promise\PromiseInterface

Наследование: extends Kraken\Promise\DeferredInterface
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

abort() публичный Метод

Transform Promise's value by applying a function to the Promise's cancellation value. Returns a new promise for the transformed result.
См. также: PromiseInterface::then
public abort ( callable $onCancel ) : Kraken\Promise\PromiseInterface
$onCancel callable
Результат Kraken\Promise\PromiseInterface

always() публичный Метод

Apply cleanup handler that fires regardless of Promise resolution state and suppress return value.
См. также: PromiseInterface::then
public always ( callable $onFulfilledOrRejected ) : Kraken\Promise\PromiseInterface
$onFulfilledOrRejected callable
Результат Kraken\Promise\PromiseInterface

done() публичный Метод

Returns null.
public done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : null
$onFulfilled callable
$onRejected callable
$onCancel callable
Результат null

failure() публичный Метод

Transform Promise's value by applying a function to the Promise's rejection value. Returns a new promise for the transformed result.
См. также: PromiseInterface::then
public failure ( callable $onFailure ) : Kraken\Promise\PromiseInterface
$onFailure callable
Результат Kraken\Promise\PromiseInterface

isCancelled() публичный Метод

Check if Promise is cancelled.
public isCancelled ( ) : boolean
Результат boolean

isFulfilled() публичный Метод

Check if Promise is fulfilled.
public isFulfilled ( ) : boolean
Результат boolean

isPending() публичный Метод

Check if Promise is still pending.
public isPending ( ) : boolean
Результат boolean

isRejected() публичный Метод

Check if Promise is rejected.
public isRejected ( ) : boolean
Результат boolean

spread() публичный Метод

Returns a new promise for the transformed result.
См. также: PromiseInterface::then
public spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null ) : Kraken\Promise\PromiseInterface
$onFulfilled callable
$onRejected callable
$onCancel callable
Результат Kraken\Promise\PromiseInterface

success() публичный Метод

Transform Promise's value by applying a function to the Promise's fulfillment value. Returns a new promise for the transformed result.
См. также: PromiseInterface::then
public success ( callable $onSuccess ) : Kraken\Promise\PromiseInterface
$onSuccess callable
Результат Kraken\Promise\PromiseInterface

then() публичный Метод

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
Результат Kraken\Promise\PromiseInterface