/**
* @param int $count
* @param int $minVerbosity
*
* @return ProgressBar
*/
public function createProgressBar($count, $minVerbosity = OutputInterface::VERBOSITY_NORMAL)
{
$stream = new NullOutput();
if ($this->applicationInput->hasOption('progress') && $this->applicationInput->getOption('progress')) {
if ($this->applicationOutput instanceof ConsoleOutput) {
if ($this->applicationOutput->getVerbosity() >= $minVerbosity) {
$stream = $this->applicationOutput->getErrorOutput();
}
}
}
$progress = new ProgressBar($stream, $count);
// add an additional space, in case logging is also enabled
$progress->setFormat($progress->getFormatDefinition('normal') . ' ');
$progress->start();
return $progress;
}