Skip to content

Commit

Permalink
allow cursor to be used even when STDIN is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jun 7, 2020
1 parent 00bed12 commit 0f0a271
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cursor.php
Expand Up @@ -21,10 +21,10 @@ final class Cursor
private $output;
private $input;

public function __construct(OutputInterface $output, $input = STDIN)
public function __construct(OutputInterface $output, $input = null)
{
$this->output = $output;
$this->input = $input;
$this->input = $input ?? (\defined('STDIN') ? STDIN : fopen('php://input', 'r+'));
}

public function moveUp(int $lines = 1): self
Expand Down

0 comments on commit 0f0a271

Please sign in to comment.