function Create::iterFor
Returns an iterator for the given value.
Parameters
mixed $value:
1 call to Create::iterFor()
- EachPromise::__construct in vendor/
guzzlehttp/ promises/ src/ EachPromise.php - Configuration hash can include the following key value pairs:
File
-
vendor/
guzzlehttp/ promises/ src/ Create.php, line 67
Class
Namespace
GuzzleHttp\PromiseCode
public static function iterFor($value) : \Iterator {
if ($value instanceof \Iterator) {
return $value;
}
if (is_array($value)) {
return new \ArrayIterator($value);
}
return new \ArrayIterator([
$value,
]);
}