Skip to content

Commit 0e45e29

Browse files
committed
feature #4655 Document new progressbar methods (javiereguiluz)
This PR was merged into the 2.6 branch. Discussion ---------- Document new progressbar methods | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.6+ | Fixed tickets | #4593 Commits ------- 6a3cbd9 Changed the "new in Symfony 2.6" message for consistency 2b86d80 Documented getProgress/setProgress methods
2 parents 921f3cd + 6a3cbd9 commit 0e45e29

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

components/console/helpers/progressbar.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ 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 called ``setCurrent()`` prior to Symfony 2.6.
4649

4750
.. caution::
4851

@@ -300,10 +303,13 @@ that displays the number of remaining steps::
300303
ProgressBar::setPlaceholderFormatterDefinition(
301304
'remaining_steps',
302305
function (ProgressBar $bar, OutputInterface $output) {
303-
return $bar->getMaxSteps() - $bar->getStep();
306+
return $bar->getMaxSteps() - $bar->getProgress();
304307
}
305308
);
306309

310+
.. versionadded:: 2.6
311+
The ``getProgress()`` method was called ``getStep()`` prior to Symfony 2.6.
312+
307313
Custom Messages
308314
~~~~~~~~~~~~~~~
309315

0 commit comments

Comments
 (0)