@@ -16,24 +16,24 @@ number of units, and advance the progress as the command executes::
1616 use Symfony\Component\Console\Helper\ProgressBar;
1717
1818 // creates a new progress bar (50 units)
19- $progress = new ProgressBar($output, 50);
19+ $progressBar = new ProgressBar($output, 50);
2020
2121 // starts and displays the progress bar
22- $progress ->start();
22+ $progressBar ->start();
2323
2424 $i = 0;
2525 while ($i++ < 50) {
2626 // ... do some work
2727
2828 // advances the progress bar 1 unit
29- $progress ->advance();
29+ $progressBar ->advance();
3030
3131 // you can also advance the progress bar by more than 1 unit
32- // $progress ->advance(3);
32+ // $progressBar ->advance(3);
3333 }
3434
3535 // ensures that the progress bar is at 100%
36- $progress ->finish();
36+ $progressBar ->finish();
3737
3838Instead of advancing the bar by a number of steps (with the
3939:method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::advance ` method),
@@ -64,7 +64,7 @@ If you don't know the number of steps in advance, just omit the steps argument
6464when creating the :class: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar `
6565instance::
6666
67- $progress = new ProgressBar($output);
67+ $progressBar = new ProgressBar($output);
6868
6969The progress will then be displayed as a throbber:
7070
@@ -131,7 +131,7 @@ level of verbosity of the ``OutputInterface`` instance:
131131Instead of relying on the verbosity mode of the current command, you can also
132132force a format via ``setFormat() ``::
133133
134- $bar ->setFormat('verbose');
134+ $progressBar ->setFormat('verbose');
135135
136136The built-in formats are the following:
137137
@@ -153,7 +153,7 @@ Custom Formats
153153
154154Instead of using the built-in formats, you can also set your own::
155155
156- $bar ->setFormat('%bar%');
156+ $progressBar ->setFormat('%bar%');
157157
158158This sets the format to only display the progress bar itself:
159159
@@ -180,7 +180,7 @@ current progress of the bar. Here is a list of the built-in placeholders:
180180For instance, here is how you could set the format to be the same as the
181181``debug `` one::
182182
183- $bar ->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
183+ $progressBar ->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
184184
185185Notice the ``:6s `` part added to some placeholders? That's how you can tweak
186186the appearance of the bar (formatting and alignment). The part after the colon
@@ -191,8 +191,8 @@ also define global formats::
191191
192192 ProgressBar::setFormatDefinition('minimal', 'Progress: %percent%%');
193193
194- $bar = new ProgressBar($output, 3);
195- $bar ->setFormat('minimal');
194+ $progressBar = new ProgressBar($output, 3);
195+ $progressBar ->setFormat('minimal');
196196
197197This code defines a new ``minimal `` format that you can then use for your
198198progress bars:
@@ -216,8 +216,8 @@ variant::
216216 ProgressBar::setFormatDefinition('minimal', '%percent%% %remaining%');
217217 ProgressBar::setFormatDefinition('minimal_nomax', '%percent%%');
218218
219- $bar = new ProgressBar($output);
220- $bar ->setFormat('minimal');
219+ $progressBar = new ProgressBar($output);
220+ $progressBar ->setFormat('minimal');
221221
222222When displaying the progress bar, the format will automatically be set to
223223``minimal_nomax `` if the bar does not have a maximum number of steps like in
@@ -246,16 +246,16 @@ Amongst the placeholders, ``bar`` is a bit special as all the characters used
246246to display it can be customized::
247247
248248 // the finished part of the bar
249- $progress ->setBarCharacter('<comment>=</comment>');
249+ $progressBar ->setBarCharacter('<comment>=</comment>');
250250
251251 // the unfinished part of the bar
252- $progress ->setEmptyBarCharacter(' ');
252+ $progressBar ->setEmptyBarCharacter(' ');
253253
254254 // the progress character
255- $progress ->setProgressCharacter('|');
255+ $progressBar ->setProgressCharacter('|');
256256
257257 // the bar width
258- $progress ->setBarWidth(50);
258+ $progressBar ->setBarWidth(50);
259259
260260.. caution ::
261261
@@ -265,17 +265,17 @@ to display it can be customized::
265265 :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::setRedrawFrequency `,
266266 so it updates on only some iterations::
267267
268- $progress = new ProgressBar($output, 50000);
269- $progress ->start();
268+ $progressBar = new ProgressBar($output, 50000);
269+ $progressBar ->start();
270270
271271 // update every 100 iterations
272- $progress ->setRedrawFrequency(100);
272+ $progressBar ->setRedrawFrequency(100);
273273
274274 $i = 0;
275275 while ($i++ < 50000) {
276276 // ... do some work
277277
278- $progress ->advance();
278+ $progressBar ->advance();
279279 }
280280
281281Custom Placeholders
@@ -288,8 +288,8 @@ that displays the number of remaining steps::
288288
289289 ProgressBar::setPlaceholderFormatterDefinition(
290290 'remaining_steps',
291- function (ProgressBar $bar , OutputInterface $output) {
292- return $bar ->getMaxSteps() - $bar ->getProgress();
291+ function (ProgressBar $progressBar , OutputInterface $output) {
292+ return $progressBar ->getMaxSteps() - $progressBar ->getProgress();
293293 }
294294 );
295295
0 commit comments