@@ -173,6 +173,8 @@ will be autocompleted as the user types::
173
173
public function execute(InputInterface $input, OutputInterface $output)
174
174
{
175
175
// ...
176
+ $helper = $this->getHelper('question');
177
+
176
178
$bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
177
179
$question = new Question('Please enter the name of a bundle', 'FooBundle');
178
180
$question->setAutocompleterValues($bundles);
@@ -192,6 +194,8 @@ convenient for passwords::
192
194
public function execute(InputInterface $input, OutputInterface $output)
193
195
{
194
196
// ...
197
+ $helper = $this->getHelper('question');
198
+
195
199
$question = new Question('What is the database password?');
196
200
$question->setHidden(true);
197
201
$question->setHiddenFallback(false);
@@ -225,6 +229,8 @@ method::
225
229
public function execute(InputInterface $input, OutputInterface $output)
226
230
{
227
231
// ...
232
+ $helper = $this->getHelper('question');
233
+
228
234
$question = new Question('Please enter the name of the bundle', 'AppBundle');
229
235
$question->setNormalizer(function ($value) {
230
236
// $value can be null here
@@ -256,6 +262,8 @@ method::
256
262
public function execute(InputInterface $input, OutputInterface $output)
257
263
{
258
264
// ...
265
+ $helper = $this->getHelper('question');
266
+
259
267
$question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle');
260
268
$question->setValidator(function ($answer) {
261
269
if (!is_string($answer) || 'Bundle' !== substr($answer, -6)) {
0 commit comments