File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 55use Symfony \Bundle \FrameworkBundle \Console \Application ;
66use Symfony \Component \Console \Helper \QuestionHelper ;
77use Symfony \Component \Console \Input \InputInterface ;
8+ use Symfony \Component \Console \Input \StreamableInputInterface ;
89use Symfony \Component \Console \Input \StringInput ;
910use Symfony \Component \Console \Output \OutputInterface ;
1011use Symfony \Component \Console \Output \StreamOutput ;
@@ -117,9 +118,14 @@ public function getStatusCode()
117118
118119 private function setInputStream ($ inputStream )
119120 {
120- $ helper = $ this ->application ->getHelperSet ()->get ('question ' );
121- /* @var $helper QuestionHelper */
122- $ helper ->setInputStream ($ inputStream );
121+ if ($ this ->input instanceof StreamableInputInterface) {
122+ $ this ->input ->setStream ($ inputStream );
123+ } else {
124+ // Symfony < 4.0
125+ $ helper = $ this ->application ->getHelperSet ()->get ('question ' );
126+ /* @var $helper QuestionHelper */
127+ $ helper ->setInputStream ($ inputStream );
128+ }
123129 }
124130
125131 private function disableStty ()
You can’t perform that action at this time.
0 commit comments