diff --git a/Cursor.php b/Cursor.php index 9f8be9649..2da899b55 100644 --- a/Cursor.php +++ b/Cursor.php @@ -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