allow cursor to be used even when STDIN is not defined

This commit is contained in:
Christian Flothmann 2020-06-07 21:21:28 +02:00
parent 5de548b60e
commit aff1ffaeff

View File

@ -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