From 18fe182ad64336e270bc7282ac681cef9a1792ff Mon Sep 17 00:00:00 2001 From: James Halsall Date: Fri, 2 Sep 2016 15:48:07 +0100 Subject: [PATCH 1/2] Update ProgressBar docs with regress information --- components/console/helpers/progressbar.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index 0e63e2e37a2..f231d0b71e6 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -35,6 +35,13 @@ number of units, and advance the progress as the command executes:: // ensure that the progress bar is at 100% $progress->finish(); +.. tip:: + + You can also regress the progress bar (i.e. step backwards) by using the + ``$progress->regress()`` method. Like the ``advance()`` method you can also + pass a unit value to ``regress()`` to control how many steps the progress is + regressed by. + Instead of advancing the bar by a number of steps (with the :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::advance` method), you can also set the current progress by calling the From c0613704d3396f854bc1b696e5cd25f1eb4211ad Mon Sep 17 00:00:00 2001 From: James Halsall Date: Mon, 19 Sep 2016 09:34:18 +0100 Subject: [PATCH 2/2] Correct the regress ProgressBar docs --- components/console/helpers/progressbar.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index f231d0b71e6..6b26d0def28 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -37,10 +37,9 @@ number of units, and advance the progress as the command executes:: .. tip:: - You can also regress the progress bar (i.e. step backwards) by using the - ``$progress->regress()`` method. Like the ``advance()`` method you can also - pass a unit value to ``regress()`` to control how many steps the progress is - regressed by. + You can also regress the progress bar (i.e. step backwards) by calling + ``$progress->advance()`` with a negative value. For example, if you call + ``$progress->advance(-2)`` then it will regress the progress bar 2 steps. Instead of advancing the bar by a number of steps (with the :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::advance` method),