mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 02:14:31 +02:00
Fixed PHPstan issues for level 5.
This commit is contained in:
parent
a9293b7ceb
commit
da72f5b3ec
24 changed files with 87 additions and 49 deletions
|
@ -96,19 +96,19 @@ class PasswordResetManager
|
|||
/**
|
||||
* Sets the new password of the user with the given name, if the token is valid.
|
||||
*
|
||||
* @param string $user The name of the user, which password should be reset
|
||||
* @param string $username The name of the user, which password should be reset
|
||||
* @param string $token The token that should be used to reset the password
|
||||
* @param string $new_password The new password that should be applied to user
|
||||
*
|
||||
* @return bool Returns true, if the new password was applied. False, if either the username is unknown or the
|
||||
* token is invalid or expired.
|
||||
*/
|
||||
public function setNewPassword(string $user, string $token, string $new_password): bool
|
||||
public function setNewPassword(string $username, string $token, string $new_password): bool
|
||||
{
|
||||
//Try to find the user
|
||||
$repo = $this->em->getRepository(User::class);
|
||||
/** @var User $user */
|
||||
$user = $repo->findOneBy(['name' => $user]);
|
||||
/** @var User|null $user */
|
||||
$user = $repo->findOneBy(['name' => $username]);
|
||||
|
||||
//If no user matching the name, show an error message
|
||||
if (null === $user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue