class SymfonyQuestionHelper extends QuestionHelper

Symfony Style Guide compliant question helper.

Properties

protected $helperSet from Helper

Methods

setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

from Helper
getHelperSet()

Gets the helper set associated with this helper.

from Helper
static int
strlen(string $string)

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

from Helper
static 
formatTime($secs)

No description

from Helper
static 
formatMemory($memory)

No description

from Helper
static 
strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)

No description

from Helper
static 
removeDecoration(OutputFormatterInterface $formatter, $string)

No description

from Helper
mixed
ask(InputInterface $input, OutputInterface $output, Question $question)

Asks a question to the user.

setInputStream(resource $stream)

Sets the input stream to read from when interacting with the user.

resource
getInputStream()

Returns the helper's input stream.

string
getName()

Returns the canonical name of this helper.

bool|mixed|string|null
doAsk(OutputInterface $output, Question $question)

Asks the question to the user.

writePrompt(OutputInterface $output, Question $question)

Outputs the question prompt.

writeError(OutputInterface $output, Exception $error)

Outputs an error message.

Details

in Helper at line 28
setHelperSet(HelperSet $helperSet = null)

Sets the helper set associated with this helper.

Parameters

HelperSet $helperSet

in Helper at line 36
HelperSet getHelperSet()

Gets the helper set associated with this helper.

Return Value

HelperSet A HelperSet instance

in Helper at line 48
static int strlen(string $string)

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

Parameters

string $string The string to check its length

Return Value

int The length of the string

in Helper at line 57
static formatTime($secs)

Parameters

$secs

in Helper at line 86
static formatMemory($memory)

Parameters

$memory

in Helper at line 103
static strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)

Parameters

OutputFormatterInterface $formatter
$string

in Helper at line 108
static removeDecoration(OutputFormatterInterface $formatter, $string)

Parameters

OutputFormatterInterface $formatter
$string

at line 33
mixed ask(InputInterface $input, OutputInterface $output, Question $question)

Asks a question to the user.

Parameters

InputInterface $input
OutputInterface $output
Question $question

Return Value

mixed The user answer

Exceptions

RuntimeException If there is no data to read in the input stream

in QuestionHelper at line 90
setInputStream(resource $stream)

Sets the input stream to read from when interacting with the user.

This is mainly useful for testing purpose.

Parameters

resource $stream The input stream

Exceptions

InvalidArgumentException In case the stream is not a resource

in QuestionHelper at line 104
resource getInputStream()

Returns the helper's input stream.

Return Value

resource

in QuestionHelper at line 112
string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

in QuestionHelper at line 126
bool|mixed|string|null doAsk(OutputInterface $output, Question $question)

Asks the question to the user.

This method is public for PHP 5.3 compatibility, it should be private.

Parameters

OutputInterface $output
Question $question

Return Value

bool|mixed|string|null

Exceptions

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

at line 55
protected writePrompt(OutputInterface $output, Question $question)

Outputs the question prompt.

Parameters

OutputInterface $output
Question $question

at line 109
protected writeError(OutputInterface $output, Exception $error)

Outputs an error message.

Parameters

OutputInterface $output
Exception $error