Pārlūkot izejas kodu

merged branch michelsalib/patch-1 (PR #1877)

Commits
-------

1087792 -- fix use of STDIN

Discussion
----------

Fix use of STDIN

As seen here : https://github.com/symfony/symfony/commit/07298ac699a648e67095575f5fa2004359dbf7a9#commitcomment-505409. The use of STDIN can be confluctual on some specific cases.
Fabien Potencier 14 gadi atpakaļ
vecāks
revīzija
efba810aeb

+ 2 - 2
src/Symfony/Component/Console/Helper/DialogHelper.php

@@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface;
  */
 class DialogHelper extends Helper
 {
-    private $inputStream = STDIN;
+    private $inputStream;
 
     /**
      * Asks a question to the user.
@@ -35,7 +35,7 @@ class DialogHelper extends Helper
     {
         $output->write($question);
 
-        $ret = fgets($this->inputStream, 4096);
+        $ret = fgets($this->inputStream ?: STDIN, 4096);
         if (false === $ret) {
             throw new \RuntimeException('Aborted');
         }