Skip to content

Commit 9cde0d5

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: minor. refs #13027 Fix example with iterable
2 parents 9c1e884 + fe6c38f commit 9cde0d5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/console/helpers/progressbar.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ which starts, advances and finishes the progress bar automatically::
105105

106106
$progressBar = new ProgressBar($output);
107107

108-
// $iterable can be for example an array ([1, 2, 3, ...]) or a generator
109-
// $iterable = function () { yield 1; yield 2; ... };
108+
// $iterable can be array
109+
$iterable = [1, 2];
110110
foreach ($progressBar->iterate($iterable) as $value) {
111111
// ... do some work
112112
}
113113

114-
If ``$iterable = [1, 2]``, the previous code will output the following:
114+
// or a generator
115+
function iterable() { yield 1; yield 2; ... };
116+
foreach ($progressBar->iterate(iterable()) as $value) {
117+
// ... do some work
118+
}
119+
120+
The previous code will output:
115121

116122
.. code-block:: text
117123

0 commit comments

Comments
 (0)