Skip to content

Commit 47edc03

Browse files
authored
Update progressbar.rst
1 parent 189f4c2 commit 47edc03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/console/helpers/progressbar.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ which starts, advances and finishes the progress bar automatically::
106106
$progressBar = new ProgressBar($output);
107107

108108
// $iterable can be for example an array ([1, 2, 3, ...])
109-
foreach ($progressBar->iterate([1, 2, 3]) as $value) {
109+
$iterable = [1, 2];
110+
foreach ($progressBar->iterate($iterable) as $value) {
110111
// ... do some work
111112
}
113+
112114
// or a generator
113-
// function iterable() { yield 1; yield 2; ... };
115+
function iterable() { yield 1; yield 2; ... };
114116
foreach ($progressBar->iterate(iterable()) as $value) {
115117
// ... do some work
116118
}

0 commit comments

Comments
 (0)