8000 [RFC] add input to the arguments of dialog helper by cordoval · Pull Request #8366 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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

Conversation

cordoval
Copy link
Contributor

addresses #8079

@cordoval
Copy link
Contributor Author

@fabpot :shipit:

👶 👍

@wouterj
Copy link
Member
wouterj commented Jun 27, 2013

These are pretty big BC breaks, aren't they?

@cordoval
Copy link
Contributor Author

@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?

@wouterj
Copy link
Member
wouterj commented Jun 27, 2013

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".

@cordoval
Copy link
Contributor Author

let's the guardians decide how to solve these situations, if there is a cleaner way suggest if not let's wait

@stof
Copy link
Member
stof commented Jun 27, 2013

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);
Copy link
Member

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')

@cordoval
Copy link
Contributor Author

@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

@stof
Copy link
Member
stof commented Jun 28, 2013

@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

@fabpot
Copy link
Member
fabpot commented Jul 8, 2013

This is indeed a huge BC break that we cannot accept. Unfortunately, we need to find another solution to fix the issue.

@fabpot
Copy link
Member
fabpot commented Jul 21, 2013

Closing in favor of #8452

@fabpot fabpot closed this Jul 21, 2013
fabpot added a commit that referenced this pull request Jul 21, 2013
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
@cordoval cordoval deleted the bugfix/DialogHelperRespectInteractionSetting branch July 21, 2013 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0