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 c2a12eb + a4dd8e2 commit cc59a66Copy full SHA for cc59a66
components/console/helpers/questionhelper.rst
@@ -429,8 +429,11 @@ You can also use a validator with a hidden question::
429
$helper = $this->getHelper('question');
430
431
$question = new Question('Please enter your password');
432
+ $question->setNormalizer(function ($value) {
433
+ return $value ?? '';
434
+ });
435
$question->setValidator(function ($value) {
- if (trim($value) == '') {
436
+ if ('' === trim($value)) {
437
throw new \Exception('The password cannot be empty');
438
}
439
0 commit comments