-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Added the ability to return the default answer in a question #11975
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
[Console] Added the ability to return the default answer in a question #11975
Conversation
eb10681
to
756103d
Compare
* | ||
* @return Question The current instance | ||
*/ | ||
public function setShowDefault($showDefault) |
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.
What about setting a default of true?
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.
Not sure if we should be more explicit and require true to be passed. Another opinion please?
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.
@wouterj You mean line 28 not the method parameter, don't you?
👍 |
756103d
to
b6ccce8
Compare
@@ -25,6 +25,7 @@ class Question | |||
private $autocompleterValues; | |||
private $validator; | |||
private $default; | |||
private $showDefault = false; |
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.
Thinking about usability, should the default be shown by default?
With the changes being made to the helpers to adhere to the style guide I wonder if this should be done in the Also, according to the current draft of the style guide the output should be: |
IMO, this is the wrong implementation. Putting the default as part of the message returned by |
@ThomasLomas Can you take into account the comments from @stof and update the PR accordingly? |
Considering that there now is a SymfonyStyle feature (which, among other things, adds the default value to the question) is this PR still relevant? |
As a result I think this can be closed. Thanks. |
This gives the option of showing the default answer along with the question. The documentation is a work in progress.