Permalink
Browse files

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
  • Loading branch information...
weaverryan committed Dec 22, 2014
2 parents 921f3cd + 6a3cbd9 commit 0e45e292f210aa162c6bfccfef11ccaa76026b7b
Showing with 8 additions and 2 deletions.
  1. +8 −2 components/console/helpers/progressbar.rst
@@ -42,7 +42,10 @@ 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 called ``setCurrent()`` prior to Symfony 2.6.
.. caution::
@@ -300,10 +303,13 @@ 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 called ``getStep()`` prior to Symfony 2.6.
Custom Messages
~~~~~~~~~~~~~~~

0 comments on commit 0e45e29

Please sign in to comment.