Skip to content

Document new progressbar methods #4655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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
~~~~~~~~~~~~~~~

Expand Down