allow cursor to be used even when STDIN is not defined
This commit is contained in:
parent
5de548b60e
commit
aff1ffaeff
@ -21,10 +21,10 @@ final class Cursor
|
|||||||
private $output;
|
private $output;
|
||||||
private $input;
|
private $input;
|
||||||
|
|
||||||
public function __construct(OutputInterface $output, $input = STDIN)
|
public function __construct(OutputInterface $output, $input = null)
|
||||||
{
|
{
|
||||||
$this->output = $output;
|
$this->output = $output;
|
||||||
$this->input = $input;
|
$this->input = $input ?? (\defined('STDIN') ? STDIN : fopen('php://input', 'r+'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function moveUp(int $lines = 1): self
|
public function moveUp(int $lines = 1): self
|
||||||
|
Reference in New Issue
Block a user