diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index d5ddf83a2e3..9159f66f652 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -420,6 +420,9 @@ You can also use a validator with a hidden question:: $helper = $this->getHelper('question'); $question = new Question('Please enter your password'); + $question->setNormalizer(function ($value) { + return null === $value ? '' : $value; + }); $question->setValidator(function ($value) { if (trim($value) == '') { throw new \Exception('The password cannot be empty');