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 5de548b commit 2d4a203
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Symfony/Component/Console/Cursor.php
Expand Up @@ -21,8 +21,16 @@ final class Cursor
private $output;
private $input;

public function __construct(OutputInterface $output, $input = STDIN)
public function __construct(OutputInterface $output, $input = null)
{
if (null === $input && !\defined('STDIN')) {
throw new \TypeError(sprintf('The second argument of "%s()" must be a resource.', __METHOD__));
}

if (null === $input) {
$input = STDIN;
}

$this->output = $output;
$this->input = $input;
}
Expand Down

0 comments on commit 2d4a203

Please sign in to comment.