diff --git a/src/Terminal/Terminal.php b/src/Terminal/Terminal.php index ec7a1e8..f5236c5 100644 --- a/src/Terminal/Terminal.php +++ b/src/Terminal/Terminal.php @@ -60,8 +60,7 @@ public function switchToNormalMode(): self public function render( InteractiveComponent $component, - array $footerLines = [], - bool $renderFooter = true, + array $footerLines = [] ): Generator { $rendered = $component->render(); @@ -74,14 +73,12 @@ public function render( } foreach ($rendered as $content) { - if ($renderFooter || $footerLines !== []) { - if ($footer = $component->renderFooter()) { - $footerLines = [...$footerLines, $footer]; - } - - if ($footerLines !== []) { - $content .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $footerLines); - } + if ($footer = $component->renderFooter()) { + $footerLines[] = $footer; + } + + if ($footerLines !== []) { + $content .= PHP_EOL . PHP_EOL . implode(PHP_EOL, $footerLines); } $this