1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Applied StyleCI changes, added php/larastan to attribution

This commit is contained in:
Dan Brown
2021-11-05 16:27:59 +00:00
parent bc291bee78
commit 5c6a6b50a0
8 changed files with 15 additions and 9 deletions

View File

@ -51,11 +51,13 @@ class CreateAdmin extends Command
}
if (mb_strlen($email) < 5 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
$this->error('Invalid email address provided');
return SymfonyCommand::FAILURE;
}
if ($this->userRepo->getByEmail($email) !== null) {
$this->error('A user with the provided email already exists!');
return SymfonyCommand::FAILURE;
}
@ -65,6 +67,7 @@ class CreateAdmin extends Command
}
if (mb_strlen($name) < 2) {
$this->error('Invalid name provided');
return SymfonyCommand::FAILURE;
}
@ -74,6 +77,7 @@ class CreateAdmin extends Command
}
if (mb_strlen($password) < 5) {
$this->error('Invalid password provided, Must be at least 5 characters');
return SymfonyCommand::FAILURE;
}
@ -84,6 +88,7 @@ class CreateAdmin extends Command
$user->save();
$this->info("Admin account with email \"{$user->email}\" successfully created!");
return SymfonyCommand::SUCCESS;
}
}