8000 bug #8367 Update questionhelper.rst (yceruto) · symfony/symfony-docs@ad2aa31 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad2aa31

Browse files
committed
bug #8367 Update questionhelper.rst (yceruto)
This PR was squashed before being merged into the 2.7 branch (closes #8367). Discussion ---------- Update questionhelper.rst Add missed variable `$helper` in some examples. Commits ------- 6128928 Update questionhelper.rst
2 parents a5d15d2 + 6128928 commit ad2aa31

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ will be autocompleted as the user types::
173173
public function execute(InputInterface $input, OutputInterface $output)
174174
{
175175
// ...
176+
$helper = $this->getHelper('question');
177+
176178
$bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
177179
$question = new Question('Please enter the name of a bundle', 'FooBundle');
178180
$question->setAutocompleterValues($bundles);
@@ -192,6 +194,8 @@ convenient for passwords::
192194
public function execute(InputInterface $input, OutputInterface $output)
193195
{
194196
// ...
197+
$helper = $this->getHelper('question');
198+
195199
$question = new Question('What is the database password?');
196200
$question->setHidden(true);
197201
$question->setHiddenFallback(false);
@@ -225,6 +229,8 @@ method::
225229
public function execute(InputInterface $input, OutputInterface $output)
226230
{
227231
// ...
232+
$helper = $this->getHelper('question');
233+
228234
$question = new Question('Please enter the name of the bundle', 'AppBundle');
229235
$question->setNormalizer(function ($value) {
230236
// $value can be null here
@@ -256,6 +262,8 @@ method::
256262
public function execute(InputInterface $input, OutputInterface $output)
257263
{
258264
// ...
265+
$helper = $this->getHelper('question');
266+
259267
$question = new Question('Please enter the name of the bundle', 'AcmeDemoBundle');
260268
$question->setValidator(function ($answer) {
261269
if (!is_string($answer) || 'Bundle' !== substr($answer, -6)) {

0 commit comments

Comments
 (0)
0