Skip to content

Commit 2b86d80

Browse files
committed
Documented getProgress/setProgress methods
1 parent a2ea256 commit 2b86d80

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

components/console/helpers/progressbar.rst

+10-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ number of units, and advance the progress as the command executes::
4242
Instead of advancing the bar by a number of steps (with the
4343
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::advance` method),
4444
you can also set the current progress by calling the
45-
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setCurrent` method.
45+
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method.
46+
47+
.. versionadded:: 2.6
48+
The ``setProgress()`` method was introduced in Symfony 2.6. Previously it was
49+
called ``setCurrent()``.
4650

4751
.. caution::
4852

@@ -300,10 +304,14 @@ that displays the number of remaining steps::
300304
ProgressBar::setPlaceholderFormatterDefinition(
301305
'remaining_steps',
302306
function (ProgressBar $bar, OutputInterface $output) {
303-
return $bar->getMaxSteps() - $bar->getStep();
307+
return $bar->getMaxSteps() - $bar->getProgress();
304308
}
305309
);
306310

311+
.. versionadded:: 2.6
312+
The ``getProgress()`` method was introduced in Symfony 2.6. Previously it was
313+
called ``getStep()``.
314+
307315
Custom Messages
308316
~~~~~~~~~~~~~~~
309317

0 commit comments

Comments
 (0)