TYPO3
7.6
|
Public Member Functions | |
ask (InputInterface $input, OutputInterface $output, Question $question) | |
setInputStream ($stream) | |
getInputStream () | |
getName () | |
doAsk (OutputInterface $output, Question $question) | |
Public Member Functions inherited from Helper | |
setHelperSet (HelperSet $helperSet=null) | |
getHelperSet () | |
Protected Member Functions | |
writePrompt (OutputInterface $output, Question $question) | |
writeError (OutputInterface $output,\Exception $error) | |
Private Member Functions | |
autocomplete (OutputInterface $output, Question $question, $inputStream) | |
getHiddenResponse (OutputInterface $output, $inputStream) | |
validateAttempts ($interviewer, OutputInterface $output, Question $question) | |
getShell () | |
hasSttyAvailable () | |
Private Attributes | |
$inputStream | |
Static Private Attributes | |
static | $shell |
static | $stty |
Additional Inherited Members | |
Static Public Member Functions inherited from Helper | |
static | strlen ($string) |
static | formatTime ($secs) |
static | formatMemory ($memory) |
static | strlenWithoutDecoration (OutputFormatterInterface $formatter, $string) |
Protected Attributes inherited from Helper | |
$helperSet = null | |
The QuestionHelper class provides helpers to interact with the user.
Definition at line 25 of file QuestionHelper.php.
ask | ( | InputInterface | $input, |
OutputInterface | $output, | ||
Question | $question | ||
) |
Asks a question to the user.
InputInterface | $input | An InputInterface instance |
OutputInterface | $output | An OutputInterface instance |
Question | $question | The question to ask |
\RuntimeException | If there is no data to read in the input stream |
Definition at line 42 of file QuestionHelper.php.
References QuestionHelper\doAsk(), Question\getDefault(), Question\getValidator(), InputInterface\isInteractive(), and QuestionHelper\validateAttempts().
|
private |
Autocompletes a question.
OutputInterface | $output | |
Question | $question |
Definition at line 200 of file QuestionHelper.php.
References QuestionHelper\$inputStream, elseif, Question\getAutocompleterValues(), OutputInterface\getFormatter(), Helper\strlen(), and OutputInterface\write().
Referenced by QuestionHelper\doAsk().
doAsk | ( | OutputInterface | $output, |
Question | $question | ||
) |
Asks the question to the user.
This method is public for PHP 5.3 compatibility, it should be private.
OutputInterface | $output | |
Question | $question |
\Exception | |
\RuntimeException |
Definition at line 110 of file QuestionHelper.php.
References QuestionHelper\$inputStream, QuestionHelper\autocomplete(), Question\getAutocompleterValues(), Question\getDefault(), QuestionHelper\getHiddenResponse(), Question\getNormalizer(), QuestionHelper\hasSttyAvailable(), Question\isHidden(), Question\isHiddenFallback(), Helper\strlen(), and QuestionHelper\writePrompt().
Referenced by QuestionHelper\ask().
|
private |
Gets a hidden response from user.
OutputInterface | $output | An Output instance |
\RuntimeException | In case the fallback is deactivated and the response cannot be hidden |
Definition at line 319 of file QuestionHelper.php.
References QuestionHelper\$inputStream, QuestionHelper\$shell, QuestionHelper\getShell(), QuestionHelper\hasSttyAvailable(), and OutputInterface\writeln().
Referenced by QuestionHelper\doAsk().
getInputStream | ( | ) |
Returns the helper's input stream.
Definition at line 84 of file QuestionHelper.php.
References QuestionHelper\$inputStream.
getName | ( | ) |
{Returns the canonical name of this helper.
Implements HelperInterface.
Definition at line 92 of file QuestionHelper.php.
|
private |
Returns a valid unix shell.
Definition at line 404 of file QuestionHelper.php.
Referenced by QuestionHelper\getHiddenResponse().
|
private |
Returns whether Stty is available or not.
Definition at line 431 of file QuestionHelper.php.
Referenced by QuestionHelper\doAsk(), and QuestionHelper\getHiddenResponse().
setInputStream | ( | $stream | ) |
Sets the input stream to read from when interacting with the user.
This is mainly useful for testing purpose.
resource | $stream | The input stream |
\InvalidArgumentException | In case the stream is not a resource |
Definition at line 70 of file QuestionHelper.php.
|
private |
Validates an attempt.
callable | $interviewer | A callable that will ask for a question and return the result |
OutputInterface | $output | An Output instance |
Question | $question | A Question instance |
\Exception | In case the max number of attempts has been reached and no valid response has been given |
Definition at line 381 of file QuestionHelper.php.
References Question\getMaxAttempts(), Question\getValidator(), and QuestionHelper\writeError().
Referenced by QuestionHelper\ask().
|
protected |
Outputs an error message.
OutputInterface | $output | |
\Exception | $error |
Definition at line 181 of file QuestionHelper.php.
References Helper\getHelperSet(), and OutputInterface\writeln().
Referenced by QuestionHelper\validateAttempts().
|
protected |
Outputs the question prompt.
OutputInterface | $output | |
Question | $question |
Definition at line 155 of file QuestionHelper.php.
References Question\getQuestion(), OutputInterface\write(), and OutputInterface\writeln().
Referenced by QuestionHelper\doAsk().
|
private |
Definition at line 27 of file QuestionHelper.php.
Referenced by QuestionHelper\autocomplete(), QuestionHelper\doAsk(), QuestionHelper\getHiddenResponse(), and QuestionHelper\getInputStream().
|
staticprivate |
Definition at line 28 of file QuestionHelper.php.
Referenced by QuestionHelper\getHiddenResponse().
|
staticprivate |
Definition at line 29 of file QuestionHelper.php.