GuzzleHttpPromiseeach

Given an iterator that yields promises or values, returns a promise that is fulfilled with a null value when the iterator has been consumed or the aggregate promise has been fulfilled or rejected.

Description

GuzzleHttp\Promise\each( (mixed) $iterable, (constant) callable $onFulfilled = null, (null) callable $onRejected = null ); 

$onFulfilled is a function that accepts the fulfilled value, iterator index, and the aggregate promise. The callback can invoke any necessary side effects and choose to resolve or reject the aggregate promise if needed.

$onRejected is a function that accepts the rejection reason, iterator index, and the aggregate promise. The callback can invoke any necessary side effects and choose to resolve or reject the aggregate promise if needed.

Parameters (3)

0. $iterable (mixed)
Iterator or array to iterate over.
1. $onfulfilled — Optional. (constant) => callable $onFulfilled = null
The onfulfilled.
2. $onrejected — Optional. (null) => callable $onRejected = null
The onrejected.

Usage

  1. if ( !function_exists( 'GuzzleHttp\Promise\each' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Promise/functions.php'; 
  3.  
  4. // Iterator or array to iterate over. 
  5. $iterable = null; 
  6.  
  7. // The onfulfilled. 
  8. $onfulfilled = callable $onFulfilled = null; 
  9.  
  10. // The onrejected. 
  11. $onrejected = callable $onRejected = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = GuzzleHttp\Promise\each($iterable, $onfulfilled, $onrejected); 
  15.  

Defined (1)

The function is defined in the following location(s).

/lib/Azure/GuzzleHttp/Promise/functions.php