diff --git a/src/View/LineView.php b/src/View/LineView.php index d872332..7f40e50 100644 --- a/src/View/LineView.php +++ b/src/View/LineView.php @@ -6,8 +6,6 @@ class LineView extends View { - protected string $streamName = 'php://stdout'; - public function newLine(int $count = 1): void { for ($i = 0; $i < $count; $i++) { diff --git a/src/View/ProgressBarView.php b/src/View/ProgressBarView.php index ee54fae..dac2334 100644 --- a/src/View/ProgressBarView.php +++ b/src/View/ProgressBarView.php @@ -16,8 +16,6 @@ class ProgressBarView extends View protected int $total = 100; - protected string $streamName = 'php://stderr'; - public function create(int $total): static { $this->total = max(1, $total); diff --git a/src/View/TableView.php b/src/View/TableView.php index 576854e..8d5f4ff 100644 --- a/src/View/TableView.php +++ b/src/View/TableView.php @@ -14,8 +14,6 @@ class TableView extends View { - protected string $streamName = 'php://stdout'; - public function show(array $data): void { $headers = $this->headers($data); diff --git a/src/View/View.php b/src/View/View.php index 286b676..d10d40c 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -12,8 +12,6 @@ abstract class View /** @var resource|null */ protected static mixed $stream = null; - protected string $streamName; - protected function writeLine(string $line): void { fwrite($this->stream(), $line . PHP_EOL); @@ -29,6 +27,6 @@ protected function write(string $line): void */ protected function stream() { - return static::$stream ??= fopen($this->streamName, 'wb'); + return static::$stream ??= fopen('php://stderr', 'wb'); } }