Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Use of undefined constant STDIN - assumed 'STDIN'" #37124

Closed
francoism90 opened this issue Jun 6, 2020 · 2 comments
Closed

"Use of undefined constant STDIN - assumed 'STDIN'" #37124

francoism90 opened this issue Jun 6, 2020 · 2 comments

Comments

@francoism90
Copy link

Symfony version(s) affected: symfony/console v5.1.0

Description
I'm keep getting his error on Laravel, I don't know if this should be reported to them or if this is a Symfony issue?

How to reproduce
Update to latest deps.

Possible Solution
I don't think the constant exists when using it as a dep, shouldn't it be checked if it is?

Additional context
Converting the constant works fine, but I don't think this is the solution:

public function __construct(OutputInterface $output, $input = 'STDIN')
    {
        $this->output = $output;
        $this->input = $input;
    }
@xabbuh
Copy link
Member

xabbuh commented Jun 7, 2020

I think #37130 should fix this.

@fabpot fabpot closed this as completed Jun 8, 2020
fabpot added a commit that referenced this issue Jun 8, 2020
…efined (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
@francoism90
Copy link
Author

@fabpot Thanks for the fix. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants