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