diff --git a/src/Components/Interactive/ProgressBarComponent.php b/src/Components/Interactive/ProgressBarComponent.php index d2365f4..29414cb 100644 --- a/src/Components/Interactive/ProgressBarComponent.php +++ b/src/Components/Interactive/ProgressBarComponent.php @@ -51,7 +51,7 @@ public function render(): Generator $bar, $step, $count, - ) . PHP_EOL; + ); }; foreach ($this->data as $item) { diff --git a/src/Terminal/Terminal.php b/src/Terminal/Terminal.php index f5236c5..096703f 100644 --- a/src/Terminal/Terminal.php +++ b/src/Terminal/Terminal.php @@ -73,12 +73,14 @@ public function render( } foreach ($rendered as $content) { + $footerLinesForContent = $footerLines; + if ($footer = $component->renderFooter()) { - $footerLines[] = $footer; + $footerLinesForContent[] = $footer; } - if ($footerLines !== []) { - $content .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $footerLines); + if ($footerLinesForContent !== []) { + $content .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $footerLinesForContent); } $this