DialogHelper deprecated::askAndValidate()

mixed askAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, string $default = null, array $autocomplete = null)

Asks for a value and validates the response.

The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.

Parameters

OutputInterface $output An Output instance
string|array $question The question to ask
callable $validator A PHP callback
int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
string $default The default answer if none is given by the user
array $autocomplete List of values to autocomplete

Return Value

mixed

Exceptions

Exception When any of the validators return an error
doc_Symfony
2016-10-28 06:14:11
Comments
Leave a Comment

Please login to continue.