@@ 327-345 (lines=19) @@ | ||
324 | * |
|
325 | * @return string |
|
326 | */ |
|
327 | private function askConfirmation(InputInterface $input, OutputInterface $output, $questionText, $default, $separator) |
|
328 | { |
|
329 | $questionHelper = $this->getQuestionHelper(); |
|
330 | ||
331 | // NEXT_MAJOR: Remove this BC code for SensioGeneratorBundle 2.3/2.4 after dropping support for Symfony 2.3 |
|
332 | if ($questionHelper instanceof DialogHelper) { |
|
333 | $question = $questionHelper->getQuestion($questionText, $default, $separator); |
|
334 | ||
335 | return $questionHelper->askConfirmation($output, $question, ($default === 'no' ? false : true)); |
|
336 | } |
|
337 | ||
338 | $question = new ConfirmationQuestion($questionHelper->getQuestion( |
|
339 | $questionText, |
|
340 | $default, |
|
341 | $separator |
|
342 | ), ($default === 'no' ? false : true)); |
|
343 | ||
344 | return $questionHelper->ask($input, $output, $question); |
|
345 | } |
|
346 | ||
347 | /** |
|
348 | * @return string |
@@ 74-92 (lines=19) @@ | ||
71 | * |
|
72 | * @return string |
|
73 | */ |
|
74 | private function askConfirmation(InputInterface $input, OutputInterface $output, $questionText, $default, $separator) |
|
75 | { |
|
76 | $questionHelper = $this->getQuestionHelper(); |
|
77 | ||
78 | // NEXT_MAJOR: Remove this BC code for SensioGeneratorBundle 2.3/2.4 after dropping support for Symfony 2.3 |
|
79 | if ($questionHelper instanceof DialogHelper) { |
|
80 | $question = $questionHelper->getQuestion($questionText, $default, $separator); |
|
81 | ||
82 | return $questionHelper->askConfirmation($output, $question, ($default === 'no' ? false : true)); |
|
83 | } |
|
84 | ||
85 | $question = new ConfirmationQuestion($questionHelper->getQuestion( |
|
86 | $questionText, |
|
87 | $default, |
|
88 | $separator |
|
89 | ), ($default === 'no' ? false : true)); |
|
90 | ||
91 | return $questionHelper->ask($input, $output, $question); |
|
92 | } |
|
93 | ||
94 | /** |
|
95 | * @return QuestionHelper|DialogHelper |