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
20
vendor/symfony/console/Helper/ProgressHelper.php
vendored
20
vendor/symfony/console/Helper/ProgressHelper.php
vendored
|
@ -12,7 +12,9 @@
|
|||
namespace Symfony\Component\Console\Helper;
|
||||
|
||||
use Symfony\Component\Console\Output\NullOutput;
|
||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Exception\LogicException;
|
||||
|
||||
/**
|
||||
* The Progress class provides helpers to display progress output.
|
||||
|
@ -193,6 +195,10 @@ class ProgressHelper extends Helper
|
|||
*/
|
||||
public function start(OutputInterface $output, $max = null)
|
||||
{
|
||||
if ($output instanceof ConsoleOutputInterface) {
|
||||
$output = $output->getErrorOutput();
|
||||
}
|
||||
|
||||
$this->startTime = time();
|
||||
$this->current = 0;
|
||||
$this->max = (int) $max;
|
||||
|
@ -236,7 +242,7 @@ class ProgressHelper extends Helper
|
|||
* @param int $step Number of steps to advance
|
||||
* @param bool $redraw Whether to redraw or not
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function advance($step = 1, $redraw = false)
|
||||
{
|
||||
|
@ -249,18 +255,18 @@ class ProgressHelper extends Helper
|
|||
* @param int $current The current progress
|
||||
* @param bool $redraw Whether to redraw or not
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function setCurrent($current, $redraw = false)
|
||||
{
|
||||
if (null === $this->startTime) {
|
||||
throw new \LogicException('You must start the progress bar before calling setCurrent().');
|
||||
throw new LogicException('You must start the progress bar before calling setCurrent().');
|
||||
}
|
||||
|
||||
$current = (int) $current;
|
||||
|
||||
if ($current < $this->current) {
|
||||
throw new \LogicException('You can\'t regress the progress bar');
|
||||
throw new LogicException('You can\'t regress the progress bar');
|
||||
}
|
||||
|
||||
if (0 === $this->current) {
|
||||
|
@ -282,12 +288,12 @@ class ProgressHelper extends Helper
|
|||
*
|
||||
* @param bool $finish Forces the end result
|
||||
*
|
||||
* @throws \LogicException
|
||||
* @throws LogicException
|
||||
*/
|
||||
public function display($finish = false)
|
||||
{
|
||||
if (null === $this->startTime) {
|
||||
throw new \LogicException('You must start the progress bar before calling display().');
|
||||
throw new LogicException('You must start the progress bar before calling display().');
|
||||
}
|
||||
|
||||
$message = $this->format;
|
||||
|
@ -315,7 +321,7 @@ class ProgressHelper extends Helper
|
|||
public function finish()
|
||||
{
|
||||
if (null === $this->startTime) {
|
||||
throw new \LogicException('You must start the progress bar before calling finish().');
|
||||
throw new LogicException('You must start the progress bar before calling finish().');
|
||||
}
|
||||
|
||||
if (null !== $this->startTime) {
|
||||
|
|
Reference in a new issue