Skip to content

Commit

Permalink
-- fix use of STDIN
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Salib committed Aug 1, 2011
1 parent 5b5dc45 commit 1087792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Helper/DialogHelper.php
Expand Up @@ -20,7 +20,7 @@
*/
class DialogHelper extends Helper
{
private $inputStream = STDIN;
private $inputStream;

/**
* Asks a question to the user.
Expand All @@ -35,7 +35,7 @@ public function ask(OutputInterface $output, $question, $default = null)
{
$output->write($question);

$ret = fgets($this->inputStream, 4096);
$ret = fgets($this->inputStream ?: STDIN, 4096);
if (false === $ret) {
throw new \RuntimeException('Aborted');
}
Expand Down

0 comments on commit 1087792

Please sign in to comment.