Documentation

Create
in package

FinalYes

Table of Contents

Methods

exceptionFor()  : Throwable
Create an exception for a rejected promise value.
iterFor()  : Iterator
Returns an iterator for the given value.
promiseFor()  : PromiseInterface
Creates a promise for a value if the value is not a promise.
rejectionFor()  : PromiseInterface
Creates a rejected promise for a reason if the reason is not a promise.

Methods

exceptionFor()

Create an exception for a rejected promise value.

public static exceptionFor(mixed $reason) : Throwable
Parameters
$reason : mixed
Return values
Throwable

iterFor()

Returns an iterator for the given value.

public static iterFor(mixed $value) : Iterator
Parameters
$value : mixed
Return values
Iterator

promiseFor()

Creates a promise for a value if the value is not a promise.

public static promiseFor(mixed $value) : PromiseInterface
Parameters
$value : mixed

Promise or value.

Return values
PromiseInterface

rejectionFor()

Creates a rejected promise for a reason if the reason is not a promise.

public static rejectionFor(mixed $reason) : PromiseInterface

If the provided reason is a promise, then it is returned as-is.

Parameters
$reason : mixed

Promise or reason.

Return values
PromiseInterface

        
On this page

Search results