You are here

function settle in Auth0 Single Sign On 8.2

Returns a promise that is fulfilled when all of the provided promises have been fulfilled or rejected.

The returned promise is fulfilled with an array of inspection state arrays.

Parameters

mixed $promises Promises or values.:

Return value

PromiseInterface

See also

GuzzleHttp\Promise\inspect for the inspection state array format.

File

vendor/guzzlehttp/promises/src/functions.php, line 309

Namespace

GuzzleHttp\Promise

Code

function settle($promises) {
  $results = [];
  return each($promises, function ($value, $idx) use (&$results) {
    $results[$idx] = [
      'state' => PromiseInterface::FULFILLED,
      'value' => $value,
    ];
  }, function ($reason, $idx) use (&$results) {
    $results[$idx] = [
      'state' => PromiseInterface::REJECTED,
      'reason' => $reason,
    ];
  })
    ->then(function () use (&$results) {
    ksort($results);
    return $results;
  });
}