phpstan level 1 errors reduction

This commit is contained in:
marko
2025-11-20 20:02:26 +01:00
parent f28fa7b51b
commit 275b6481cc
40 changed files with 223 additions and 152 deletions

View File

@@ -75,11 +75,8 @@ function array_keys_exist(array $array, $keys)
function updateUserPassword($db, $userId, $password)
{
// we don't save the actual password but it's hash
if ($password != "") {
$password = password_hash($password, PASSWORD_DEFAULT);
} else {
$password = null;
}
$password =
$password != "" ? password_hash($password, PASSWORD_DEFAULT) : null;
$query =
"UPDATE `cwsvjudo_main`.`wkParticipo_Users` SET `pwHash`=:val WHERE `id`=:id;";
@@ -114,7 +111,7 @@ function changePassword(
return false;
}
$changerInfo = getUserData($db, $changerId);
$changerInfo = getUserData($changerId);
// check the password of the changer
if (!password_verify($changerPassword, $changerInfo["pwHash"])) {