Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProgressBar.php

function ProgressBar::__construct

Parameters

int $max Maximum steps (0 if unknown):

File

vendor/symfony/console/Helper/ProgressBar.php, line 70

Class

ProgressBar
The ProgressBar provides helpers to display progress output.

Namespace

Symfony\Component\Console\Helper

Code

public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) {
    if ($output instanceof ConsoleOutputInterface) {
        $output = $output->getErrorOutput();
    }
    $this->output = $output;
    $this->setMaxSteps($max);
    $this->terminal = new Terminal();
    if (0 < $minSecondsBetweenRedraws) {
        $this->redrawFreq = null;
        $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws;
    }
    if (!$this->output
        ->isDecorated()) {
        // disable overwrite when output does not support ANSI codes.
        $this->overwrite = false;
        // set a reasonable redraw frequency so output isn't flooded
        $this->redrawFreq = null;
    }
    $this->startTime = time();
    $this->cursor = new Cursor($output);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal