@@ -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
3838.. tip ::
3939
@@ -59,7 +59,7 @@ If you don't know the number of steps in advance, just omit the steps argument
5959when creating the :class: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar `
6060instance::
6161
62- $progress = new ProgressBar($output);
62+ $progressBar = new ProgressBar($output);
6363
6464The progress will then be displayed as a throbber:
6565
@@ -126,7 +126,7 @@ level of verbosity of the ``OutputInterface`` instance:
126126Instead of relying on the verbosity mode of the current command, you can also
127127force a format via ``setFormat() ``::
128128
129- $bar ->setFormat('verbose');
129+ $progressBar ->setFormat('verbose');
130130
131131The built-in formats are the following:
132132
@@ -148,7 +148,7 @@ Custom Formats
148148
149149Instead of using the built-in formats, you can also set your own::
150150
151- $bar ->setFormat('%bar%');
151+ $progressBar ->setFormat('%bar%');
152152
153153This sets the format to only display the progress bar itself:
154154
@@ -175,7 +175,7 @@ current progress of the bar. Here is a list of the built-in placeholders:
175175For instance, here is how you could set the format to be the same as the
176176``debug `` one::
177177
178- $bar ->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
178+ $progressBar ->setFormat(' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
179179
180180Notice the ``:6s `` part added to some placeholders? That's how you can tweak
181181the appearance of the bar (formatting and alignment). The part after the colon
@@ -186,8 +186,8 @@ also define global formats::
186186
187187 ProgressBar::setFormatDefinition('minimal', 'Progress: %percent%%');
188188
189- $bar = new ProgressBar($output, 3);
190- $bar ->setFormat('minimal');
189+ $progressBar = new ProgressBar($output, 3);
190+ $progressBar ->setFormat('minimal');
191191
192192This code defines a new ``minimal `` format that you can then use for your
193193progress bars:
@@ -211,8 +211,8 @@ variant::
211211 ProgressBar::setFormatDefinition('minimal', '%percent%% %remaining%');
212212 ProgressBar::setFormatDefinition('minimal_nomax', '%percent%%');
213213
214- $bar = new ProgressBar($output);
215- $bar ->setFormat('minimal');
214+ $progressBar = new ProgressBar($output);
215+ $progressBar ->setFormat('minimal');
216216
217217When displaying the progress bar, the format will automatically be set to
218218``minimal_nomax `` if the bar does not have a maximum number of steps like in
@@ -241,16 +241,16 @@ Amongst the placeholders, ``bar`` is a bit special as all the characters used
241241to display it can be customized::
242242
243243 // the finished part of the bar
244- $progress ->setBarCharacter('<comment>=</comment>');
244+ $progressBar ->setBarCharacter('<comment>=</comment>');
245245
246246 // the unfinished part of the bar
247- $progress ->setEmptyBarCharacter(' ');
247+ $progressBar ->setEmptyBarCharacter(' ');
248248
249249 // the progress character
250- $progress ->setProgressCharacter('|');
250+ $progressBar ->setProgressCharacter('|');
251251
252252 // the bar width
253- $progress ->setBarWidth(50);
253+ $progressBar ->setBarWidth(50);
254254
255255.. caution ::
256256
@@ -260,17 +260,17 @@ to display it can be customized::
260260 :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::setRedrawFrequency `,
261261 so it updates on only some iterations::
262262
263- $progress = new ProgressBar($output, 50000);
264- $progress ->start();
263+ $progressBar = new ProgressBar($output, 50000);
264+ $progressBar ->start();
265265
266266 // update every 100 iterations
267- $progress ->setRedrawFrequency(100);
267+ $progressBar ->setRedrawFrequency(100);
268268
269269 $i = 0;
270270 while ($i++ < 50000) {
271271 // ... do some work
272272
273- $progress ->advance();
273+ $progressBar ->advance();
274274 }
275275
276276Custom Placeholders
@@ -283,8 +283,8 @@ that displays the number of remaining steps::
283283
284284 ProgressBar::setPlaceholderFormatterDefinition(
285285 'remaining_steps',
286- function (ProgressBar $bar , OutputInterface $output) {
287- return $bar ->getMaxSteps() - $bar ->getProgress();
286+ function (ProgressBar $progressBar , OutputInterface $output) {
287+ return $progressBar ->getMaxSteps() - $progressBar ->getProgress();
288288 }
289289 );
290290
0 commit comments