Fixed static analysis issue and added test for UserRepository

This commit is contained in:
Jan Böhmer 2023-08-01 16:20:31 +02:00
parent c981476706
commit b3153dac68
5 changed files with 117 additions and 3 deletions

View file

@ -97,8 +97,7 @@ class PasswordResetManager
{
//Try to find the user
$repo = $this->em->getRepository(User::class);
/** @var User|null $user */
$user = $repo->findOneBy(['name' => $username]);
$user = $repo->findByUsername($username);
//If no user matching the name, show an error message
if (!$user instanceof User) {