From 036d2763fbe449aee40ba820c6405889cb9c337b Mon Sep 17 00:00:00 2001 From: Jan De Coster Date: Wed, 7 May 2014 21:27:18 +0200 Subject: [PATCH 1/2] Update dialoghelper.rst At the "Validating a Hidden Response" the example validation didn't respond anything so the $password var was NULL --- components/console/helpers/dialoghelper.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 6917d807235..dda787af70c 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -159,6 +159,7 @@ You can also ask and validate a hidden response:: if (trim($value) == '') { throw new \Exception('The password can not be empty'); } + return $value; }; $password = $dialog->askHiddenResponseAndValidate( From c1812a9d6f75b7a1f154d12c77e4f6a317992be3 Mon Sep 17 00:00:00 2001 From: Jan De Coster Date: Thu, 8 May 2014 15:21:58 +0200 Subject: [PATCH 2/2] Update dialoghelper.rst --- components/console/helpers/dialoghelper.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index dda787af70c..fdfcbdf72b2 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -156,9 +156,10 @@ 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; };