diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 6917d807235..fdfcbdf72b2 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -156,9 +156,11 @@ You can also ask and validate a hidden response:: $dialog = $this->getHelperSet()->get('dialog'); $validator = function ($value) { - if (trim($value) == '') { + if ('' === trim($value)) { throw new \Exception('The password can not be empty'); } + + return $value; }; $password = $dialog->askHiddenResponseAndValidate(