From c1a039542b64f684c26e41d1e95d91256d739edd Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Thu, 7 Sep 2017 10:23:52 -0400 Subject: [PATCH 1/2] Update questionhelper.rst Fix undefined variable `$helper`. --- components/console/helpers/questionhelper.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index f3376ae49a3..ca3e867d080 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -256,6 +256,8 @@ method:: public function execute(InputInterface $input, OutputInterface $output) { // ... + $helper = $this->getHelper('question'); + $question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle'); $question->setValidator(function ($answer) { if (!is_string($answer) || 'Bundle' !== substr($answer, -6)) { From 3cf5478668de7564d9ed2c527a4c96a19c1ae262 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Fri, 8 Sep 2017 12:22:35 -0400 Subject: [PATCH 2/2] More fixes --- components/console/helpers/questionhelper.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index ca3e867d080..1b6a26e8256 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -173,6 +173,8 @@ will be autocompleted as the user types:: public function execute(InputInterface $input, OutputInterface $output) { // ... + $helper = $this->getHelper('question'); + $bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle'); $question = new Question('Please enter the name of a bundle', 'FooBundle'); $question->setAutocompleterValues($bundles); @@ -192,6 +194,8 @@ convenient for passwords:: public function execute(InputInterface $input, OutputInterface $output) { // ... + $helper = $this->getHelper('question'); + $question = new Question('What is the database password?'); $question->setHidden(true); $question->setHiddenFallback(false); @@ -225,6 +229,8 @@ method:: public function execute(InputInterface $input, OutputInterface $output) { // ... + $helper = $this->getHelper('question'); + $question = new Question('Please enter the name of the bundle', 'AppBundle'); $question->setNormalizer(function ($value) { // $value can be null here