src/Co.php
private function promiseAll(array $yieldables, $throw_acceptable)
    {
        $promises = [];
        foreach ($yieldables as $yieldable) {
            // Add or enqueue cURL handles
            if (TypeUtils::isCurl($yieldable['value'])) {
                $promises[(string)$yieldable['value']] = $this->pool->addCurl($yieldable['value']);
                continue;
            }
            // Process generators
            if (TypeUtils::isGeneratorContainer($yieldable['value'])) {
                $promises[(string)$yieldable['value']] = $this->processGeneratorContainer($yieldable['value']);
                continue;
            }
        }
        // If caller cannot accept exception,
        // we handle rejected value as resolved.
        if (!$throw_acceptable) {
            $promises = array_map(
                ['\mpyw\Co\Internal\YieldableUtils', 'safePromise'],
                $promises
            );
        }
        return \React\Promise\all($promises);
    }
private function promiseAll(array $yieldables, $throw_acceptable)
    {
        $promises = [];
        foreach ($yieldables as $yieldable) {
            // Add or enqueue cURL handles
            if (TypeUtils::isCurl($yieldable['value'])) {
                $promises[(string)$yieldable['value']] = $this->pool->addCurl($yieldable['value']);
                continue;
            }
            // Process generators
            if (TypeUtils::isGeneratorContainer($yieldable['value'])) {
                $promises[(string)$yieldable['value']] = $this->processGeneratorContainer($yieldable['value']);
                continue;
            }
        }
        // If caller cannot accept exception,
        // we handle rejected value as resolved.
        if (!$throw_acceptable) {
            $promises = array_map(
                ['\mpyw\Co\Internal\YieldableUtils', 'safePromise'],
                $promises
            );
        }
        return \React\Promise\all($promises);
    }
private function promiseAll ( array $ yieldables , $ throw_acceptable ) { $ promises = [ ] ; foreach ( $ yieldables as $ yieldable ) { // Add or enqueue cURL handles if ( TypeUtils :: isCurl ( $ yieldable [ 'value' ] ) ) { $ promises [ ( string ) $ yieldable [ 'value' ] ] = $ this -> pool -> addCurl ( $ yieldable [ 'value' ] ) ; continue ; } // Process generators if ( TypeUtils :: isGeneratorContainer ( $ yieldable [ 'value' ] ) ) { $ promises [ ( string ) $ yieldable [ 'value' ] ] = $ this -> processGeneratorContainer ( $ yieldable [ 'value' ] ) ; continue ; } } // If caller cannot accept exception, // we handle rejected value as resolved. if ( ! $ throw_acceptable ) { $ promises = array_map ( [ '\mpyw\Co\Internal\YieldableUtils' , 'safePromise' ] , $ promises ) ; } return \ React \ Promise \ all ( $ promises ) ; }
Promise all changes in yieldables are prepared.
@param  array $yieldables
@param  bool  $throw_acceptable
@return PromiseInterface
Promise all changes in yieldables are prepared .