PHP Интерфейс GraphQL\Executor\Promise\PromiseAdapter

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
createPromise ( callable $resolver ) : GraphQL\Executor\Promise\Promise Creates a Promise
createPromiseAll ( mixed $promisesOrValues ) : GraphQL\Executor\Promise\Promise Given an array of promises, return a promise that is fulfilled when all the items in the array are fulfilled.
createRejectedPromise ( mixed $reason ) : GraphQL\Executor\Promise\Promise 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.
createResolvedPromise ( mixed $promiseOrValue = null ) : GraphQL\Executor\Promise\Promise Creates a full filed Promise for a value if the value is not a promise.
isPromise ( mixed $value ) : boolean Return true if value is promise

Описание методов

createPromise() публичный метод

Creates a Promise
public createPromise ( callable $resolver ) : GraphQL\Executor\Promise\Promise
$resolver callable
Результат GraphQL\Executor\Promise\Promise

createPromiseAll() публичный метод

Given an array of promises, return a promise that is fulfilled when all the items in the array are fulfilled.
public createPromiseAll ( mixed $promisesOrValues ) : GraphQL\Executor\Promise\Promise
$promisesOrValues mixed Promises or values.
Результат GraphQL\Executor\Promise\Promise equivalent to Promise.all result

createRejectedPromise() публичный метод

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.
public createRejectedPromise ( mixed $reason ) : GraphQL\Executor\Promise\Promise
$reason mixed
Результат GraphQL\Executor\Promise\Promise a rejected promise

createResolvedPromise() публичный метод

Creates a full filed Promise for a value if the value is not a promise.
public createResolvedPromise ( mixed $promiseOrValue = null ) : GraphQL\Executor\Promise\Promise
$promiseOrValue mixed
Результат GraphQL\Executor\Promise\Promise a full filed Promise

isPromise() публичный метод

Return true if value is promise
public isPromise ( mixed $value ) : boolean
$value mixed
Результат boolean