Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] SymonfyStyle - Check value isset to avoid PHP notice#34114
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
chalasr commentedOct 27, 2019
Can you please rebase against 3.4 and add a test to prevent regressions? |
leevigraham commentedOct 27, 2019
@chalasr Yep… I thought I would throw in a quick PR to get some feedback. |
xabbuh commentedOct 29, 2019
I am not really sure how this could happen. Could you please add a test that illustrates why this is necessary? |
Nek- commentedOct 29, 2019
xabbuh commentedOct 29, 2019
I think we need to clarify that the |
chalasr commentedOct 29, 2019
I thought this was about supporting using the choice key instead of the value as default, read too fast. |
leevigraham commentedOct 31, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the feedback@xabbuh
I ran into this issue when I was trying to figure out how to confirm option inputs during the interact function see:#34093 In the original example the flow should probably be that if the user enters an option skip the question but if I did that when I use the value I would need to throw an
That doesn't seem to be enforced in the
If the user is prevented an invalid default and quickly presses enter the console shows an Invalid value error and prompts the user to select a valid value. |
nicolas-grekas commentedNov 28, 2019
It looks like nothing requires it in |
leevigraham commentedNov 28, 2019
Yep that was my thinking. The implementation mirrors the |
nicolas-grekas commentedJan 8, 2020
friendly ping@leevigraham |
fabpot commentedFeb 3, 2020
Thank you@leevigraham. |
…tice (leevigraham)This PR was merged into the 3.4 branch.Discussion----------[Console] SymonfyStyle - Check value isset to avoid PHP notice| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#34093| License | MIT| Doc PR | n/aThis PR addresses the issue when a default value is not a valid choice. Currently this would throw a notice which outputs to the console.This fix is a similar implementation to the `QuestionHelper`:https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Console/Helper/QuestionHelper.php#L63Example console command and output can be found in the issue:#34093Commits-------c9072c7 Check value isset to avoid PHP notice
leevigraham commentedFeb 10, 2020
@fabpot@nicolas-grekas Thanks for merging… I was overseas on holidays for a few months. |
This PR addresses the issue when a default value is not a valid choice. Currently this would throw a notice which outputs to the console.
This fix is a similar implementation to the
QuestionHelper:https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Console/Helper/QuestionHelper.php#L63Example console command and output can be found in the issue:#34093