We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2ace65e + cc59a66 commit 779bd25Copy full SHA for 779bd25
components/console/helpers/questionhelper.rst
@@ -420,8 +420,11 @@ You can also use a validator with a hidden question::
420
$helper = $this->getHelper('question');
421
422
$question = new Question('Please enter your password');
423
+ $question->setNormalizer(function ($value) {
424
+ return $value ?? '';
425
+ });
426
$question->setValidator(function ($value) {
- if (trim($value) == '') {
427
+ if ('' === trim($value)) {
428
throw new \Exception('The password cannot be empty');
429
}
430
0 commit comments