class AbstractPrompter implements PrompterInterface (View source)

Prompter class.

Help us show dialog to ask use questions.

Methods

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

Constructor.

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

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

at line line 67
__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 96
abstract string ask(string $msg = '', string $default = '')

Show prompt to ask user.

Parameters

string $msg Question.
string $default Default value.

Return Value

string The value that use input.

at line line 107
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.

at line line 131
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.

at line line 141
IOInterface getIO()

Method to get property Io

Return Value

IOInterface

at line line 153
AbstractPrompter setIO(IOInterface $io)

Method to set property io

Parameters

IOInterface $io

Return Value

AbstractPrompter Return self to support chaining.