mirror of
https://github.com/filegator/filegator.git
synced 2025-08-13 06:43:59 +02:00
phpstan & refactoring
This commit is contained in:
@@ -101,7 +101,7 @@ class Database implements Service, AuthInterface
|
||||
], 'WHERE username = ?', $username);
|
||||
}
|
||||
|
||||
return $this->find($user->getUsername());
|
||||
return $this->find($user->getUsername()) ?: $user;
|
||||
}
|
||||
|
||||
public function add(User $user, $password): User
|
||||
@@ -119,7 +119,7 @@ class Database implements Service, AuthInterface
|
||||
'password' => $this->hashPassword($password),
|
||||
]);
|
||||
|
||||
return $this->find($user->getUsername());
|
||||
return $this->find($user->getUsername()) ?: $user;
|
||||
}
|
||||
|
||||
public function delete(User $user)
|
||||
|
@@ -96,7 +96,7 @@ class JsonFile implements Service, AuthInterface
|
||||
|
||||
$this->saveUsers($all_users);
|
||||
|
||||
return $this->find($user->getUsername());
|
||||
return $this->find($user->getUsername()) ?: $user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class JsonFile implements Service, AuthInterface
|
||||
|
||||
$this->saveUsers($all_users);
|
||||
|
||||
return $this->find($user->getUsername());
|
||||
return $this->find($user->getUsername()) ?: $user;
|
||||
}
|
||||
|
||||
public function delete(User $user)
|
||||
|
Reference in New Issue
Block a user