Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07298ac

Browse filesBrowse files
committed
Detect EOF when reading input stream
[Console] Change back to fgets() in DialogHelper
1 parent 8700cd6 commit 07298ac
Copy full SHA for 07298ac

File tree

1 file changed

+3
-2
lines changed
Filter options

1 file changed

+3
-2
lines changed

‎src/Symfony/Component/Console/Helper/DialogHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/DialogHelper.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class DialogHelper extends Helper
2222
{
23-
private $inputStream;
23+
private $inputStream = STDIN;
2424

2525
/**
2626
* Asks a question to the user.
@@ -35,7 +35,8 @@ public function ask(OutputInterface $output, $question, $default = null)
3535
{
3636
$output->write($question);
3737

38-
if (false === $ret = stream_get_line(null === $this->inputStream ? STDIN : $this->inputStream, 4096, "\n")) {
38+
$ret = fgets($this->inputStream, 4096);
39+
if (false === $ret) {
3940
throw new \RuntimeException('Aborted');
4041
}
4142
$ret = trim($ret);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.