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

Commit72ca171

Browse files
committed
bug#37130 [Console] allow cursor to be used even when STDIN is not defined (xabbuh)
This PR was merged into the 5.1 branch.Discussion----------[Console] allow cursor to be used even when STDIN is not defined| Q | A| ------------- | ---| Branch? | 5.1| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#37124| License | MIT| Doc PR |This allows to use the `Cursor` class introduced in Symfony 5.1 even when the `STDIN` constant is not defined. We did a similar bugfix in the past in the `QuestionHelper` class in#10798.Commits-------aff1ffa allow cursor to be used even when STDIN is not defined
2 parents5de548b +aff1ffa commit72ca171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/Console/Cursor.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ final class Cursor
2121
private$output;
2222
private$input;
2323

24-
publicfunction__construct(OutputInterface$output,$input =STDIN)
24+
publicfunction__construct(OutputInterface$output,$input =null)
2525
{
2626
$this->output =$output;
27-
$this->input =$input;
27+
$this->input =$input ?? (\defined('STDIN') ?STDIN :fopen('php://input','r+'));
2828
}
2929

3030
publicfunctionmoveUp(int$lines =1):self

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp