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 f46f149 + 779bd25 commit 23bafc9Copy full SHA for 23bafc9
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