FileAccess Orion

SymfonyQuestionHelper extends QuestionHelper
in package

Symfony Style Guide compliant question helper.

Tags
author

Kevin Bond kevinbond@gmail.com

Table of Contents

$helperSet  : mixed
$inputStream  : mixed
$shell  : mixed
$stty  : mixed
ask()  : mixed
Asks a question to the user.
disableStty()  : mixed
Prevents usage of stty.
formatMemory()  : mixed
formatTime()  : mixed
getHelperSet()  : HelperSet
Gets the helper set associated with this helper.
getName()  : mixed
{@inheritdoc}
removeDecoration()  : mixed
setHelperSet()  : mixed
Sets the helper set associated with this helper.
strlen()  : int
Returns the length of a string, using mb_strwidth if it is available.
strlenWithoutDecoration()  : mixed
substr()  : string
Returns the subset of a string, using mb_substr if it is available.
formatChoiceQuestionChoices()  : array<string|int, string>
writeError()  : mixed
Outputs an error message.
writePrompt()  : mixed
Outputs the question prompt.
autocomplete()  : string
Autocompletes a question.
doAsk()  : bool|mixed|string|null
Asks the question to the user.
getDefaultAnswer()  : mixed
getHiddenResponse()  : string
Gets a hidden response from user.
getShell()  : string|bool
Returns a valid unix shell.
mostRecentlyEnteredValue()  : string
validateAttempts()  : mixed
Validates an attempt.

Properties

$helperSet

protected mixed $helperSet = null

Methods

disableStty()

Prevents usage of stty.

public static disableStty() : mixed
Return values
mixed

formatMemory()

public static formatMemory(mixed $memory) : mixed
Parameters
$memory : mixed
Return values
mixed

formatTime()

public static formatTime(mixed $secs) : mixed
Parameters
$secs : mixed
Return values
mixed

getHelperSet()

Gets the helper set associated with this helper.

public getHelperSet() : HelperSet
Return values
HelperSet

A HelperSet instance

getName()

{@inheritdoc}

public getName() : mixed
Return values
mixed

setHelperSet()

Sets the helper set associated with this helper.

public setHelperSet([HelperSet $helperSet = null ]) : mixed
Parameters
$helperSet : HelperSet = null
Return values
mixed

strlen()

Returns the length of a string, using mb_strwidth if it is available.

public static strlen(string $string) : int
Parameters
$string : string

The string to check its length

Return values
int

The length of the string

substr()

Returns the subset of a string, using mb_substr if it is available.

public static substr(string $string, int $from[, int|null $length = null ]) : string
Parameters
$string : string

String to subset

$from : int

Start offset

$length : int|null = null

Length to read

Return values
string

The string subset

formatChoiceQuestionChoices()

protected formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) : array<string|int, string>
Parameters
$question : ChoiceQuestion
$tag : string
Return values
array<string|int, string>

autocomplete()

Autocompletes a question.

private autocomplete(OutputInterface $output, Question $question, resource $inputStream, callable $autocomplete) : string
Parameters
$output : OutputInterface
$question : Question
$inputStream : resource
$autocomplete : callable
Return values
string

getHiddenResponse()

Gets a hidden response from user.

private getHiddenResponse(OutputInterface $output, resource $inputStream[, bool $trimmable = true ]) : string
Parameters
$output : OutputInterface
$inputStream : resource

The handler resource

$trimmable : bool = true

Is the answer trimmable

Tags
throws
RuntimeException

In case the fallback is deactivated and the response cannot be hidden

Return values
string

getShell()

Returns a valid unix shell.

private getShell() : string|bool
Return values
string|bool

The valid shell name, false in case no valid shell is found

mostRecentlyEnteredValue()

private mostRecentlyEnteredValue(string $entered) : string
Parameters
$entered : string
Return values
string

validateAttempts()

Validates an attempt.

private validateAttempts(callable $interviewer, OutputInterface $output, Question $question) : mixed
Parameters
$interviewer : callable

A callable that will ask for a question and return the result

$output : OutputInterface
$question : Question
Tags
throws
Exception

In case the max number of attempts has been reached and no valid response has been given

Return values
mixed

The validated response

Search results