Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
23
vendor/symfony/console/Helper/ProgressBar.php
vendored
23
vendor/symfony/console/Helper/ProgressBar.php
vendored
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Console\Helper;
|
|||
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Exception\LogicException;
|
||||
|
||||
/**
|
||||
* The ProgressBar provides helpers to display progress output.
|
||||
|
@ -67,10 +68,8 @@ class ProgressBar
|
|||
// disable overwrite when output does not support ANSI codes.
|
||||
$this->overwrite = false;
|
||||
|
||||
if ($this->max > 10) {
|
||||
// set a reasonable redraw frequency so output isn't flooded
|
||||
$this->setRedrawFrequency($max / 10);
|
||||
}
|
||||
// set a reasonable redraw frequency so output isn't flooded
|
||||
$this->setRedrawFrequency($max / 10);
|
||||
}
|
||||
|
||||
$this->startTime = time();
|
||||
|
@ -316,11 +315,11 @@ class ProgressBar
|
|||
/**
|
||||
* Sets the redraw frequency.
|
||||
*
|
||||
* @param int $freq The frequency in steps
|
||||
* @param int|float $freq The frequency in steps
|
||||
*/
|
||||
public function setRedrawFrequency($freq)
|
||||
{
|
||||
$this->redrawFreq = (int) $freq;
|
||||
$this->redrawFreq = max((int) $freq, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -346,7 +345,7 @@ class ProgressBar
|
|||
*
|
||||
* @param int $step Number of steps to advance
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function advance($step = 1)
|
||||
{
|
||||
|
@ -360,7 +359,7 @@ class ProgressBar
|
|||
*
|
||||
* @param int $step The current progress
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function setCurrent($step)
|
||||
{
|
||||
|
@ -384,13 +383,13 @@ class ProgressBar
|
|||
*
|
||||
* @param int $step The current progress
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function setProgress($step)
|
||||
{
|
||||
$step = (int) $step;
|
||||
if ($step < $this->step) {
|
||||
throw new \LogicException('You can\'t regress the progress bar.');
|
||||
throw new LogicException('You can\'t regress the progress bar.');
|
||||
}
|
||||
|
||||
if ($this->max && $step > $this->max) {
|
||||
|
@ -580,7 +579,7 @@ class ProgressBar
|
|||
},
|
||||
'remaining' => function (ProgressBar $bar) {
|
||||
if (!$bar->getMaxSteps()) {
|
||||
throw new \LogicException('Unable to display the remaining time if the maximum number of steps is not set.');
|
||||
throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.');
|
||||
}
|
||||
|
||||
if (!$bar->getProgress()) {
|
||||
|
@ -593,7 +592,7 @@ class ProgressBar
|
|||
},
|
||||
'estimated' => function (ProgressBar $bar) {
|
||||
if (!$bar->getMaxSteps()) {
|
||||
throw new \LogicException('Unable to display the estimated time if the maximum number of steps is not set.');
|
||||
throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.');
|
||||
}
|
||||
|
||||
if (!$bar->getProgress()) {
|
||||
|
|
Reference in a new issue