mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 07:25:32 +01:00
Fixed PHPstan issues for level 5.
This commit is contained in:
@@ -64,14 +64,15 @@ class SetPasswordCommand extends Command
|
||||
|
||||
/** @var User[] $users */
|
||||
$users = $this->entityManager->getRepository(User::class)->findBy(['name' => $user_name]);
|
||||
$user = $users[0];
|
||||
|
||||
if (null === $user) {
|
||||
if (empty($users)) {
|
||||
$io->error(sprintf('No user with the given username %s found in the database!', $user_name));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$user = $users[0];
|
||||
|
||||
$io->note('User found!');
|
||||
|
||||
$proceed = $io->confirm(
|
||||
|
||||
Reference in New Issue
Block a user