@@ 340-349 (lines=10) @@ | ||
337 | * |
|
338 | * @throws \Exception When any of the validators return an error |
|
339 | */ |
|
340 | public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null) |
|
341 | { |
|
342 | $that = $this; |
|
343 | ||
344 | $interviewer = function () use ($output, $question, $default, $autocomplete, $that) { |
|
345 | return $that->ask($output, $question, $default, $autocomplete); |
|
346 | }; |
|
347 | ||
348 | return $this->validateAttempts($interviewer, $output, $validator, $attempts); |
|
349 | } |
|
350 | ||
351 | /** |
|
352 | * Asks for a value, hide and validates the response. |
|
@@ 369-378 (lines=10) @@ | ||
366 | * @throws \Exception When any of the validators return an error |
|
367 | * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden |
|
368 | */ |
|
369 | public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true) |
|
370 | { |
|
371 | $that = $this; |
|
372 | ||
373 | $interviewer = function () use ($output, $question, $fallback, $that) { |
|
374 | return $that->askHiddenResponse($output, $question, $fallback); |
|
375 | }; |
|
376 | ||
377 | return $this->validateAttempts($interviewer, $output, $validator, $attempts); |
|
378 | } |
|
379 | ||
380 | /** |
|
381 | * Sets the input stream to read from when interacting with the user. |