Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3a5d508

Browse files
committed
[Console] replaced fgets by stream_get_line in DialogHelper
Problem with fgets is that false means two things: an error or the end of the stream.That's ok for STDIN, but it becomes a problem when using another stream (in a unit test for instance).
1 parent7eec2ca commit3a5d508

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function ask(OutputInterface $output, $question, $default = null)
3535
{
3636
$output->write($question);
3737

38-
if (false ===$ret =fgets(null ===$this->inputStream ?STDIN :$this->inputStream)) {
38+
if (false ===stream_get_line(null ===$this->inputStream ?STDIN :$this->inputStream,4096,"\n")) {
3939
thrownew \Exception('Aborted');
4040
}
4141
$ret =trim($ret);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp