class TextPrompter extends AbstractPrompter (View source)

General text prompter.

Methods

__construct(string $question = null, $default = null, IOInterface $io = null)

Constructor.

string
ask(string $msg = '', string $default = null)

Show prompt to ask user.

string
in(string $question = null)

Get a value from standard input.

string
__invoke(string $msg = null, string $default = null)

Proxy to ask method.

getIO()

Method to get property Io

setIO(IOInterface $io)

Method to set property io

Details

__construct(string $question = null, $default = null, IOInterface $io = null)

Constructor.

Parameters

string $question The question you want to ask.
$default $default The default value.
IOInterface $io The input object.

at line line 28
string ask(string $msg = '', string $default = null)

Show prompt to ask user.

Parameters

string $msg Question.
string $default Default value.

Return Value

string The value that use input.

string in(string $question = null)

Get a value from standard input.

Parameters

string $question The question you want to ask user.

Return Value

string The input string from standard input.

string __invoke(string $msg = null, string $default = null)

Proxy to ask method.

Parameters

string $msg Question.
string $default Default value.

Return Value

string The value that use input.

IOInterface getIO()

Method to get property Io

Return Value

IOInterface

AbstractPrompter setIO(IOInterface $io)

Method to set property io

Parameters

IOInterface $io

Return Value

AbstractPrompter Return self to support chaining.