Skip to content

Commit

Permalink
Documented getProgress/setProgress methods
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Dec 15, 2014
1 parent a2ea256 commit 2b86d80
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/console/helpers/progressbar.rst
Expand Up @@ -42,7 +42,11 @@ number of units, and advance the progress as the command executes::
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
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setCurrent` method.
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method.

.. versionadded:: 2.6
The ``setProgress()`` method was introduced in Symfony 2.6. Previously it was
called ``setCurrent()``.

.. caution::

Expand Down Expand Up @@ -300,10 +304,14 @@ that displays the number of remaining steps::
ProgressBar::setPlaceholderFormatterDefinition(
'remaining_steps',
function (ProgressBar $bar, OutputInterface $output) {
return $bar->getMaxSteps() - $bar->getStep();
return $bar->getMaxSteps() - $bar->getProgress();
}
);

.. versionadded:: 2.6
The ``getProgress()`` method was introduced in Symfony 2.6. Previously it was
called ``getStep()``.

Custom Messages
~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 2b86d80

Please sign in to comment.