Skip to content

Commit 779bd25

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Update questionhelper.rst
2 parents 2ace65e + cc59a66 commit 779bd25

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)