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