DialogHelper deprecated::askHiddenResponseAndValidate()

string askHiddenResponseAndValidate(OutputInterface $output, string|array $question, callable $validator, int|false $attempts = false, bool $fallback = true)

Asks for a value, hide 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)
bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not

Return Value

string The response

Exceptions

Exception When any of the validators return an error
RuntimeException In case the fallback is deactivated and the response can not be hidden
doc_Symfony
2016-10-28 06:14:11
Comments
Leave a Comment

Please login to continue.