Skip to content

Commit f5766ec

Browse files
Refactor newLine method by extracting buildLine helper
1 parent 85d3489 commit f5766ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/View/LineView.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ public function line(string $text): void
2727
*/
2828
public function newLine(int $count = 1): void
2929
{
30-
$lines = implode('', array_fill(0, max(1, $count), PHP_EOL));
30+
$this->writeLine(
31+
$this->buildLine(max(1, $count))
32+
);
33+
}
3134

32-
$this->writeLine($lines);
35+
protected function buildLine(int $count): string
36+
{
37+
return implode('', array_fill(0, max(1, $count), PHP_EOL));
3338
}
3439
}

0 commit comments

Comments
 (0)