private function drawIterations(Variant $variant, array $specials, $tag)
{
$this->output->write("[2K");
// clear line
$timeUnit = $variant->getSubject()->getOutputTimeUnit();
$outputMode = $variant->getSubject()->getOutputMode();
$lines = [];
$line = sprintf('%-' . self::INDENT . 's', '#' . $variant->getSubject()->getIndex());
$nbIterations = $variant->count();
for ($index = 0; $index < $nbIterations; $index++) {
$iteration = $variant->getIteration($index);
$displayTime = $this->formatIterationTime($iteration);
if (isset($specials[$iteration->getIndex()])) {
$displayTime = sprintf('<%s>%' . $this->colWidth . 's</%s>', $tag, $displayTime, $tag);
}
$line .= $displayTime;
if ($index > 0 && $index < $nbIterations - 1 && ($index + 1) % self::NUMBER_COLS == 0) {
$lines[] = $line;
$line = str_repeat(' ', self::INDENT);
}
}
$lines[] = $line;
$this->currentLine = count($lines) - 1;
$output = trim(implode(PHP_EOL, $lines));
$output .= sprintf(' (%s)', $this->timeUnit->getDestSuffix($this->timeUnit->resolveDestUnit($timeUnit), $this->timeUnit->resolveMode($outputMode)));
$this->output->write(sprintf("%s[0J", $output));
// clear rest of the line
}