PHP Класс mpyw\Co\Internal\YieldableUtils

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

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

Метод Описание
getApplier ( mixed $yielded, array $yieldables, callable $next = null ) : mixed Return function that apply changes in yieldables.
getYieldables ( mixed $value, array $keylist = [], array &$runners = [] ) : array Recursively search yieldable values.
normalize ( mixed $value, mixed $yield_key = null ) : mixed Recursively normalize value.
safePromise ( React\Promise\PromiseInterface $promise ) : React\Promise\PromiseInterface Return Promise that absorbs rejects, excluding fatal Throwable.

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

getApplier() публичный статический Метод

Return function that apply changes in yieldables.
public static getApplier ( mixed $yielded, array $yieldables, callable $next = null ) : mixed
$yielded mixed
$yieldables array
$next callable
Результат mixed

getYieldables() публичный статический Метод

Each entries are assoc those contain keys 'value' and 'keylist'. value -> the value itself. keylist -> position of the value. nests are represented as array values.
public static getYieldables ( mixed $value, array $keylist = [], array &$runners = [] ) : array
$value mixed Must be already normalized.
$keylist array Internally used.
$runners array
Результат array

normalize() публичный статический Метод

Generator Closure -> GeneratorContainer Array -> Array (children's are normalized) Others -> Others
public static normalize ( mixed $value, mixed $yield_key = null ) : mixed
$value mixed
$yield_key mixed
Результат mixed

safePromise() публичный статический Метод

Return Promise that absorbs rejects, excluding fatal Throwable.
public static safePromise ( React\Promise\PromiseInterface $promise ) : React\Promise\PromiseInterface
$promise React\Promise\PromiseInterface
Результат React\Promise\PromiseInterface