function ConsoleSectionOutput::clear
Clears previous output for this section.
Parameters
int $lines Number of lines to clear. If null, then the entire output of this section is cleared:
1 call to ConsoleSectionOutput::clear()
- ConsoleSectionOutput::overwrite in vendor/
symfony/ console/ Output/ ConsoleSectionOutput.php - Overwrites the previous output with a new message.
File
-
vendor/
symfony/ console/ Output/ ConsoleSectionOutput.php, line 64
Class
- ConsoleSectionOutput
- @author Pierre du Plessis <pdples@gmail.com> @author Gabriel Ostrolucký <gabriel.ostrolucky@gmail.com>
Namespace
Symfony\Component\Console\OutputCode
public function clear(?int $lines = null) : void {
if (!$this->content || !$this->isDecorated()) {
return;
}
if ($lines) {
array_splice($this->content, -$lines);
}
else {
$lines = $this->lines;
$this->content = [];
}
$this->lines -= $lines;
parent::doWrite($this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $lines) : $lines), false);
}