File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
components/console/helpers Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ from a predefined list::
105105 $helper = $this->getHelper('question');
106106 $question = new ChoiceQuestion(
107107 'Please select your favorite color (defaults to red)',
108+ // choices can also be PHP objects that implement __toString() method
108109 ['red', 'blue', 'yellow'],
109110 0
110111 );
@@ -116,6 +117,10 @@ from a predefined list::
116117 // ... do something with the color
117118 }
118119
120+ .. versionadded :: 5.2
121+
122+ Support for using PHP objects as choice values was introduced in Symfony 5.2.
123+
119124The option which should be selected by default is provided with the third
120125argument of the constructor. The default is ``null ``, which means that no
121126option is the default one.
You can’t perform that action at this time.
0 commit comments