Skip to content

Commit 97c3894

Browse files
committed
[Console] Fixed QuestionHelper examples
1 parent 1938c2f commit 97c3894

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/console/helpers/questionhelper.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ from a predefined list::
7777
$question = new ChoiceQuestion(
7878
'Please select your favorite color (defaults to red)',
7979
array('red', 'blue', 'yellow'),
80-
'red'
80+
0
8181
);
8282
$question->setErrorMessage('Color %s is invalid.');
8383

@@ -109,9 +109,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
109109

110110
$helper = $app->getHelperSet()->get('question');
111111
$question = new ChoiceQuestion(
112-
'Please select your favorite color (defaults to red)',
112+
'Please select your favorite colors (defaults to red and blue)',
113113
array('red', 'blue', 'yellow'),
114-
'red'
114+
'0,1'
115115
);
116116
$question->setMultiselect(true);
117117

@@ -121,6 +121,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
121121
Now, when the user enters ``1,2``, the result will be:
122122
``You have just selected: blue, yellow``.
123123

124+
If the user does not enter anything, the result will be:
125+
``You have just selected: red, blue``.
126+
124127
Autocompletion
125128
~~~~~~~~~~~~~~
126129

0 commit comments

Comments
 (0)