From 5dc9173403021abed0e334261f7ea816f40efe24 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 13 May 2021 22:39:26 +0200 Subject: [PATCH] fix murph:user:create command --- core/Command/UserCreateCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/Command/UserCreateCommand.php b/core/Command/UserCreateCommand.php index 5715663..2248210 100644 --- a/core/Command/UserCreateCommand.php +++ b/core/Command/UserCreateCommand.php @@ -42,7 +42,13 @@ class UserCreateCommand extends Command $emailQuestion = new Question('E-mail: '); $emailQuestion->setValidator(function ($value) { - return !empty($value); + if (empty($value)) { + throw new \RuntimeException( + 'The email must not be empty.' + ); + } + + return $value; }); $passwordQuestion = new Question('Password (leave empty to generate a random password): ');