Skip to content

Commit a4dd8e2

Browse files
committed
Tweaks
1 parent b24c8a4 commit a4dd8e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/console/helpers/questionhelper.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ You can also use a validator with a hidden question::
385385

386386
$question = new Question('Please enter your password');
387387
$question->setNormalizer(function ($value) {
388-
return null === $value ? '' : $value;
388+
return $value ?? '';
389389
});
390390
$question->setValidator(function ($value) {
391-
if (trim($value) == '') {
391+
if ('' === trim($value)) {
392392
throw new \Exception('The password cannot be empty');
393393
}
394394

0 commit comments

Comments
 (0)