mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
475 B
475 B
id | title |
---|---|
f5983e81-f975-4913-b6c5-5211493841b7 | iterate() method |
Syntax
$iterable = function () {
yield 1;
yield 2;
// ...
};
use Symfony\Component\Console\Helper\ProgressBar;
$progressBar = new ProgressBar($output);
foreach ($progressBar->iterate($iterable) as $value) {
// ... do some work
}
Non countable variable
foreach ($progressBar->iterate($iterable, 100) as $value) {
// ... do some work
}