SDK for PHP V3

Create
in package

FinalYes

Table of Contents

Methods

exceptionFor()  : Throwable
Returns throwable reasons as-is, or wraps non-throwable reasons in `RejectionException`.
iterFor()  : Iterator<TKey, TValue>
Returns an iterator for arrays, iterators, iterator aggregates, and traversables.
promiseFor()  : mixed
Returns `$value` when it is already a Guzzle promise, wraps foreign thenables in a Guzzle promise, or returns a fulfilled promise for plain values.
rejectionFor()  : mixed
Returns `$reason` when it is already a promise, or returns a rejected promise for plain reasons.

Methods

exceptionFor()

Returns throwable reasons as-is, or wraps non-throwable reasons in `RejectionException`.

public static exceptionFor(TReason $reason) : Throwable
Parameters
$reason : TReason
Tags
template

TReason

Return values
Throwable

iterFor()

Returns an iterator for arrays, iterators, iterator aggregates, and traversables.

public static iterFor(iterable<TKey, TValue$value) : Iterator<TKey, TValue>
Parameters
$value : iterable<TKey, TValue>
Tags
template

TKey of array-key

template

TValue

Return values
Iterator<TKey, TValue>

promiseFor()

Returns `$value` when it is already a Guzzle promise, wraps foreign thenables in a Guzzle promise, or returns a fulfilled promise for plain values.

public static promiseFor(TValue|TPromise $value) : mixed
Parameters
$value : TValue|TPromise

Promise or value.

Tags
template

TValue

template

TPromise of PromiseInterface<mixed, mixed> = PromiseInterface<mixed, mixed>

rejectionFor()

Returns `$reason` when it is already a promise, or returns a rejected promise for plain reasons.

public static rejectionFor(TReason|TPromise $reason) : mixed
Parameters
$reason : TReason|TPromise

Promise or reason.

Tags
template

TReason

template

TValue = mixed

template

TPromise of PromiseInterface<mixed, mixed> = PromiseInterface<mixed, mixed>

<-- modeled_exceptions -->
On this page