Class Create
Methods Summary
-
static
promiseFor ( mixed $value )
Creates a promise for a value if the value is not a promise.
-
static
rejectionFor ( mixed $reason )
Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.
-
static
exceptionFor ( mixed $reason )
Create an exception for a rejected promise value.
-
static
iterFor ( mixed $value )
Returns an iterator for the given value.
Methods Details
static
GuzzleHttp\Promise\PromiseInterface
promiseFor (
mixed
$value
)
Creates a promise for a value if the value is not a promise.
Parameters
mixed | $value | Promise or value. |
Returns
GuzzleHttp\Promise\PromiseInterface |
static
GuzzleHttp\Promise\PromiseInterface
rejectionFor (
mixed
$reason
)
Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.
Parameters
mixed | $reason | Promise or reason. |
Returns
GuzzleHttp\Promise\PromiseInterface |
static Exception|Throwable exceptionFor ( mixed $reason )
Create an exception for a rejected promise value.
Parameters
mixed | $reason |
Returns
Exception|Throwable |
static Iterator iterFor ( mixed $value )
Returns an iterator for the given value.
Parameters
mixed | $value |
Returns
Iterator |