composer local test update
This commit is contained in:
@@ -48,9 +48,9 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
public function setMaxHeight(int $maxHeight): void
|
||||
{
|
||||
// when changing max height, clear output of current section and redraw again with the new height
|
||||
$existingContent = $this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $this->lines) : $this->lines);
|
||||
|
||||
$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);
|
||||
@@ -119,8 +119,7 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
// re-add the line break (that has been removed in the above `explode()` for
|
||||
// - every line that is not the last line
|
||||
// - if $newline is required, also add it to the last line
|
||||
// - if it's not new line, but input ending with `\PHP_EOL`
|
||||
if ($i < $count || $newline || str_ends_with($input, \PHP_EOL)) {
|
||||
if ($i < $count || $newline) {
|
||||
$lineContent .= \PHP_EOL;
|
||||
}
|
||||
|
||||
@@ -168,6 +167,12 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
*/
|
||||
protected function doWrite(string $message, bool $newline)
|
||||
{
|
||||
// Simulate newline behavior for consistent output formatting, avoiding extra logic
|
||||
if (!$newline && str_ends_with($message, \PHP_EOL)) {
|
||||
$message = substr($message, 0, -\strlen(\PHP_EOL));
|
||||
$newline = true;
|
||||
}
|
||||
|
||||
if (!$this->isDecorated()) {
|
||||
parent::doWrite($message, $newline);
|
||||
|
||||
@@ -213,7 +218,7 @@ class ConsoleSectionOutput extends StreamOutput
|
||||
break;
|
||||
}
|
||||
|
||||
$numberOfLinesToClear += $section->lines;
|
||||
$numberOfLinesToClear += $section->maxHeight ? min($section->lines, $section->maxHeight) : $section->lines;
|
||||
if ('' !== $sectionContent = $section->getVisibleContent()) {
|
||||
if (!str_ends_with($sectionContent, \PHP_EOL)) {
|
||||
$sectionContent .= \PHP_EOL;
|
||||
|
||||
Reference in New Issue
Block a user