\GuzzleHttp\PromiseCreate

Summary

Methods
Properties
Constants
promiseFor()
rejectionFor()
exceptionFor()
iterFor()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

promiseFor()

promiseFor(mixed  $value) : \GuzzleHttp\Promise\PromiseInterface

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

Parameters

mixed $value

Promise or value.

Returns

\GuzzleHttp\Promise\PromiseInterface —

rejectionFor()

rejectionFor(mixed  $reason) : \GuzzleHttp\Promise\PromiseInterface

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 —

exceptionFor()

exceptionFor(mixed  $reason) : \Exception|\Throwable

Create an exception for a rejected promise value.

Parameters

mixed $reason

Returns

\Exception|\Throwable —

iterFor()

iterFor(mixed  $value) : \Iterator

Returns an iterator for the given value.

Parameters

mixed $value

Returns

\Iterator —