From 316a48ba695971308980222089e2e2b4096b29aa Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 8 Nov 2019 11:46:54 +0100 Subject: [PATCH] [Console] Update some method names --- components/console/helpers/progressbar.rst | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/components/console/helpers/progressbar.rst b/components/console/helpers/progressbar.rst index b27b75f5e0c..8e16d3742b5 100644 --- a/components/console/helpers/progressbar.rst +++ b/components/console/helpers/progressbar.rst @@ -50,15 +50,16 @@ you can also set the current progress by calling the If your platform doesn't support ANSI codes, updates to the progress bar are added as new lines. To prevent the output from being flooded, - use the method :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::preventRedrawFasterThan` - (it writes to the output after every N seconds) and the method + use the method :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::minSecondsBetweenRedraws` + to limit the number of redraws and the method :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setRedrawFrequency` - (it writes to the output every N iterations). By default, redraw frequency is + to redraw every N iterations. By default, redraw frequency is **100ms** or **10%** of your ``max``. .. versionadded:: 4.4 - The ``preventRedrawFasterThan()`` method was introduced in Symfony 4.4. + The ``minSecondsBetweenRedraws()`` and ``maxSecondsBetweenRedraws()`` + methods were introduced in Symfony 4.4. If you don't know the exact number of steps in advance, set it to a reasonable value and then call the ``setMaxSteps()`` method to update it as needed:: @@ -295,19 +296,18 @@ to display it can be customized:: .. caution:: For performance reasons, Symfony redraws screen every 100ms. If this is too - fast or to slow for your application, use these methods: - :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::preventRedrawFasterThan` - :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setRedrawFrequency` - :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::forceRedrawSlowerThan`:: + fast or to slow for your application, use the methods + :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::minSecondsBetweenRedraws` and + :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::maxSecondsBetweenRedraws`:: $progressBar = new ProgressBar($output, 50000); $progressBar->start(); // this redraws the screen every 100 iterations, but sets additional limits: - // don't redraw slower than 100ms (0.1) or faster than 200ms (0.2) + // don't redraw slower than 200ms (0.2) or faster than 100ms (0.1) $progressBar->setRedrawFrequency(100); - $progressBar->forceRedrawSlowerThan(0.2); - $progressBar->preventRedrawFasterThan(0.1); + $progressBar->maxSecondsBetweenRedraws(0.2); + $progressBar->minSecondsBetweenRedraws(0.1); $i = 0; while ($i++ < 50000) { @@ -318,7 +318,7 @@ to display it can be customized:: .. versionadded:: 4.4 - The ``forceRedrawSlowerThan`` and ``preventRedrawFasterThan()`` methods + The ``minSecondsBetweenRedraws`` and ``maxSecondsBetweenRedraws()`` methods were introduced in Symfony 4.4. Custom Placeholders