WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp\Promise

some() Yoast 1.0

Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises).

When count amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.

This prommise is rejected with a {@see GuzzleHttp\Promise\AggregateException} if the number of fulfilled promises is less than the desired $count.

Хуков нет.

Возвращает

PromiseInterface.

Использование

some( $count, $promises );
$count(число) (обязательный)
Total number of promises.
$promises(смешанный) (обязательный)
Promises or values.

Код some() Yoast 15.6.2

<?php
function some($count, $promises)
{
    $results = [];
    $rejections = [];
    return \each($promises, function ($value, $idx, \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface $p) use(&$results, $count) {
        if ($p->getState() !== \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface::PENDING) {
            return;
        }
        $results[$idx] = $value;
        if (\count($results) >= $count) {
            $p->resolve(null);
        }
    }, function ($reason) use(&$rejections) {
        $rejections[] = $reason;
    })->then(function () use(&$results, &$rejections, $count) {
        if (\count($results) !== $count) {
            throw new \YoastSEO_Vendor\GuzzleHttp\Promise\AggregateException('Not enough promises to fulfill count', $rejections);
        }
        \ksort($results);
        return \array_values($results);
    });
}