function Utils::unwrap
Waits on all of the provided promises and returns the fulfilled values.
Returns an array that contains the value of each promise (in the same order the promises were provided). An exception is thrown if any of the promises are rejected.
Parameters
iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on.:
Throws
\Throwable on error
File
-
vendor/
guzzlehttp/ promises/ src/ Utils.php, line 117
Class
Namespace
GuzzleHttp\PromiseCode
public static function unwrap($promises) : array {
$results = [];
foreach ($promises as $key => $promise) {
$results[$key] = $promise->wait();
}
return $results;
}