Skip to content

Commit 9a65412

Browse files
committed
bug #3840 Update dialoghelper.rst (jdecoster)
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #3840). Discussion ---------- Update dialoghelper.rst At the "Validating a Hidden Response" the example validation didn't respond anything so the $password var was NULL Commits ------- c1812a9 Update dialoghelper.rst 036d276 Update dialoghelper.rst
2 parents 979533a + 0575b0a commit 9a65412

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ You can also ask and validate a hidden response::
156156
$dialog = $this->getHelperSet()->get('dialog');
157157

158158
$validator = function ($value) {
159-
if (trim($value) == '') {
159+
if ('' === trim($value)) {
160160
throw new \Exception('The password can not be empty');
161161
}
162+
163+
return $value;
162164
};
163165

164166
$password = $dialog->askHiddenResponseAndValidate(

0 commit comments

Comments
 (0)