minor #15450 [Console] Handle false return value from readline (michaelperrin)
This PR was merged into the 2.8 branch.
Discussion
----------
[Console] Handle false return value from readline
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Following #15382 and as @stof mentioned, the `false` value can be returned by `readline()` and should be handled. This fixes the problem.
Commits
-------
f5ca270
[Console] Handle false return value from readline
This commit is contained in:
commit
6c0dc5c865
|
@ -434,10 +434,10 @@ class QuestionHelper extends Helper
|
|||
$ret = readline();
|
||||
} else {
|
||||
$ret = fgets($stream, 4096);
|
||||
}
|
||||
|
||||
if (false === $ret) {
|
||||
throw new \RuntimeException('Aborted');
|
||||
}
|
||||
if (false === $ret) {
|
||||
throw new \RuntimeException('Aborted');
|
||||
}
|
||||
|
||||
return trim($ret);
|
||||
|
|
Reference in New Issue