PHP Класс Kraken\Promise\Promise

Наследование: implements Kraken\Promise\PromiseInterface, use trait Kraken\Promise\Partial\PromiseTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$canceller callable
$currentCancellations integer
$handlers callable[]
$requiredCancellations integer
$result Kraken\Promise\PromiseInterface | null

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

Метод Описание
__construct ( callable $resolver = null, callable $canceller = null )
__destruct ( )
abort ( callable $onCancel )
always ( callable $onFulfilledOrRejected )
cancel ( $reason = null )
done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
failure ( callable $onFailure )
getPromise ( )
isCancelled ( )
isFulfilled ( )
isPending ( )
isRejected ( )
reject ( $reason = null )
resolve ( $value = null )
spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
success ( callable $onSuccess )
then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )

Защищенные методы

Метод Описание
getReason ( ) : Erro\Error | Exceptio\Exception | string | null Return rejection or cancellation reason for Promise.
getResult ( ) : Kraken\Promise\PromiseInterface | null Get Promise result. Returns fulfilled, rejected or cancelled Promise for settled Promises or null for pending.
getValue ( ) : mixed | null Return primitive value associated with Promise.
mutate ( callable $resolver = null ) Mutate resolver.
settle ( Kraken\Promise\PromiseInterface $promise ) : Kraken\Promise\PromiseInterface Settle Promise with another Promise.

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

__construct() публичный метод

public __construct ( callable $resolver = null, callable $canceller = null )
$resolver callable
$canceller callable

__destruct() публичный метод

public __destruct ( )

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

public abort ( callable $onCancel )
$onCancel callable

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

public always ( callable $onFulfilledOrRejected )
$onFulfilledOrRejected callable

cancel() публичный метод

public cancel ( $reason = null )

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

public done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

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

public failure ( callable $onFailure )
$onFailure callable

getPromise() публичный метод

public getPromise ( )

getReason() защищенный метод

Return rejection or cancellation reason for Promise.
protected getReason ( ) : Erro\Error | Exceptio\Exception | string | null
Результат Erro\Error | Exceptio\Exception | string | null

getResult() защищенный метод

Get Promise result. Returns fulfilled, rejected or cancelled Promise for settled Promises or null for pending.
protected getResult ( ) : Kraken\Promise\PromiseInterface | null
Результат Kraken\Promise\PromiseInterface | null

getValue() защищенный метод

Return primitive value associated with Promise.
protected getValue ( ) : mixed | null
Результат mixed | null

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

public isCancelled ( )

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

public isFulfilled ( )

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

public isPending ( )

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

public isRejected ( )

mutate() защищенный метод

Mutate resolver.
protected mutate ( callable $resolver = null )
$resolver callable

reject() публичный метод

public reject ( $reason = null )

resolve() публичный метод

public resolve ( $value = null )

settle() защищенный метод

Settle Promise with another Promise.
См. также: PromiseInterface::resolve
См. также: PromiseInterface::reject
См. также: PromiseInterface::cancel
protected settle ( Kraken\Promise\PromiseInterface $promise ) : Kraken\Promise\PromiseInterface
$promise Kraken\Promise\PromiseInterface
Результат Kraken\Promise\PromiseInterface

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

public spread ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

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

public success ( callable $onSuccess )
$onSuccess callable

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

public then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable

Описание свойств

$canceller защищенное свойство

protected callable $canceller
Результат callable

$currentCancellations защищенное свойство

protected int $currentCancellations
Результат integer

$handlers защищенное свойство

protected callable[] $handlers
Результат callable[]

$requiredCancellations защищенное свойство

protected int $requiredCancellations
Результат integer

$result защищенное свойство

protected PromiseInterface,Kraken\Promise|null $result
Результат Kraken\Promise\PromiseInterface | null