Skip to content

Commit cc59a66

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: Update questionhelper.rst
2 parents c2a12eb + a4dd8e2 commit cc59a66

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
@@ -429,8 +429,11 @@ You can also use a validator with a hidden question::
429429
$helper = $this->getHelper('question');
430430

431431
$question = new Question('Please enter your password');
432+
$question->setNormalizer(function ($value) {
433+
return $value ?? '';
434+
});
432435
$question->setValidator(function ($value) {
433-
if (trim($value) == '') {
436+
if ('' === trim($value)) {
434437
throw new \Exception('The password cannot be empty');
435438
}
436439

0 commit comments

Comments
 (0)