PHP 클래스 mpyw\Co\Internal\YieldableUtils

파일 보기 프로젝트 열기: mpyw/co 1 사용 예제들

공개 메소드들

메소드 설명
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