/**
* Defines a maximum number of lines for this section.
*
* When more lines are added, the section will automatically scroll to the
* end (i.e. remove the first lines to comply with the max height).
*/
public function setMaxHeight(int
$maxHeight): void
{ // when changing max height, clear output of current section and redraw again with the new height
$previousMaxHeight =
$this->maxHeight;
$this->maxHeight =
$maxHeight;
$existingContent =
$this->
popStreamContentUntilCurrentSection($previousMaxHeight ?
min($previousMaxHeight,
$this->lines
) :
$this->lines
);
parent::
doWrite($this->
getVisibleContent(), false
);
parent::
doWrite($existingContent, false
);
} /**
* Clears previous output for this section.
*
* @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared
*
* @return void
*/