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\HelperCode
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);
}