Skip to content

Commit 23bafc9

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Update questionhelper.rst
2 parents f46f149 + 779bd25 commit 23bafc9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,11 @@ You can also use a validator with a hidden question::
420420
$helper = $this->getHelper('question');
421421

422422
$question = new Question('Please enter your password');
423+
$question->setNormalizer(function ($value) {
424+
return $value ?? '';
425+
});
423426
$question->setValidator(function ($value) {
424-
if (trim($value) == '') {
427+
if ('' === trim($value)) {
425428
throw new \Exception('The password cannot be empty');
426429
}
427430

0 commit comments

Comments
 (0)