|
@@ 188-194 (lines=7) @@
|
| 185 |
|
* @param mixed|null $default |
| 186 |
|
* @return mixed |
| 187 |
|
*/ |
| 188 |
|
public function ask($question, $default = null) |
| 189 |
|
{ |
| 190 |
|
$helper = $this->getHelper('question'); |
| 191 |
|
$question = new Question($question, $default); |
| 192 |
|
|
| 193 |
|
return $helper->ask($this->input, $this->getOutputInterface(), $question); |
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
/** |
| 197 |
|
* Ask a password |
|
@@ 222-229 (lines=8) @@
|
| 219 |
|
* |
| 220 |
|
* @return mixed |
| 221 |
|
*/ |
| 222 |
|
public function choose($question, array $choices, $default = null) |
| 223 |
|
{ |
| 224 |
|
$helper = $this->getHelper('question'); |
| 225 |
|
$question = new ChoiceQuestion($question, $choices, $default); |
| 226 |
|
$question->setErrorMessage('%s is not a valid answer.'); |
| 227 |
|
|
| 228 |
|
return $helper->ask($this->input, $this->getOutputInterface(), $question); |
| 229 |
|
} |
| 230 |
|
|
| 231 |
|
/** |
| 232 |
|
* Ask a question where some auto-completion help is provided. |
|
@@ 240-247 (lines=8) @@
|
| 237 |
|
* |
| 238 |
|
* @return mixed |
| 239 |
|
*/ |
| 240 |
|
public function anticipate($question, array $autoCompletion, $default = null) |
| 241 |
|
{ |
| 242 |
|
$helper = $this->getHelper('question'); |
| 243 |
|
$question = new Question($question, $default); |
| 244 |
|
$question->setAutocompleterValues($autoCompletion); |
| 245 |
|
|
| 246 |
|
return $helper->ask($this->input, $this->getOutputInterface(), $question); |
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
/** |
| 250 |
|
* Ask a question where the answer is available from a list of predefined choices and more choices can be selected. |
|
@@ 258-265 (lines=8) @@
|
| 255 |
|
* |
| 256 |
|
* @return mixed |
| 257 |
|
*/ |
| 258 |
|
public function choice($question, array $choices, $default = null) |
| 259 |
|
{ |
| 260 |
|
$helper = $this->getHelper('question'); |
| 261 |
|
$question = new ChoiceQuestion($question, $choices, $default); |
| 262 |
|
$question->setMultiselect(true); |
| 263 |
|
|
| 264 |
|
return $helper->ask($this->input, $this->getOutputInterface(), $question); |
| 265 |
|
} |
| 266 |
|
} |
| 267 |
|
|