-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] add input to the arguments of dialog helper #8366
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
[RFC] add input to the arguments of dialog helper #8366
Conversation
👶 👍 |
These are pretty big BC breaks, aren't they? |
@wouterj if the breaks were on something really critical that would be something but dialog helpers, seriously? what is hard about adding the $input that was already provided by the command execute method? |
Well, it completely change the method signature of all dialog helper methods. That looks pretty big for me, especially if we "avoid BC breaks at all costs". |
let's the guardians decide how to solve these situations, if there is a cleaner way suggest if not let's wait |
This is indeed a huge BC break. Try running any of the SensioGeneratorBundle commands with your modified code and you will see it. |
{ | ||
$answer = 'z'; | ||
while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) { | ||
$answer = $this->ask($output, $question); | ||
$answer = $this->ask($input, $output, $question); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely to be an infinite loop in non-interactive mode, as $this->ask()
will return true
, not the expected string being in array('y', 'n')
@stof about the breaks for sensio generator bundle i think is acceptable if we are to fix this I will try to fix the other infinite loop thing |
@cordoval it is just an example to show you it is really a BC break. Any code using the DialogHelper would have to be rewritten, which is not an option |
This is indeed a huge BC break that we cannot accept. Unfortunately, we need to find another solution to fix the issue. |
Closing in favor of #8452 |
This PR was squashed before being merged into the master branch (closes #8452). Discussion ---------- [Console] Make DialogHelper respect interaction settings | Q | A | ------------- | --- | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8079 | License | MIT | Doc PR | - This is based on @cordoval's #8366, but it tries to not break BC and to be a little more userfriendly. @stof I can't seem to follow the infinite loop you talked about in #8366 . `DialogHelper::ask` will return the default, which is `null`, that breaks the while loop and it returns the default. Commits ------- 1cde723 [Console] Make DialogHelper respect interaction settings
addresses #8079