private function overwrite($message)
{
if ($this->overwrite) {
if (!$this->firstRun) {
// Move the cursor to the beginning of the line
$this->output->write("\r");
// Erase the line
$this->output->write("[2K");
// Erase previous lines
if ($this->formatLineCount > 0) {
$this->output->write(str_repeat("[1A[2K", $this->formatLineCount));
}
}
} elseif ($this->step > 0) {
$this->output->writeln('');
}
$this->firstRun = false;
$this->output->write($message);
}