Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/View/LineView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 0 additions & 2 deletions src/View/ProgressBarView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/View/TableView.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

class TableView extends View
{
protected string $streamName = 'php://stdout';

public function show(array $data): void
{
$headers = $this->headers($data);
Expand Down
4 changes: 1 addition & 3 deletions src/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');
}
}