Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aff1ffa

Browse files
committed
allow cursor to be used even when STDIN is not defined
1 parent 5de548b commit aff1ffa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Console/Cursor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ final class Cursor
2121
private $output;
2222
private $input;
2323

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

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

0 commit comments

Comments
 (0)