refactor: fix code style

This commit is contained in:
Jay Trees 2024-05-11 18:32:09 +02:00
parent b422805af4
commit e42c9262ef
2 changed files with 10 additions and 9 deletions

View file

@ -48,9 +48,9 @@ $config->load();
* database. * database.
*/ */
session_start( session_start(
array( [
'name' => 'wishthis', 'name' => 'wishthis',
) ]
); );
$user = User::getCurrent(); $user = User::getCurrent();

View file

@ -369,7 +369,8 @@ class User
?: $this->email; ?: $this->email;
} }
public function updatePasswordHash(string $password, string $email): string { public function updatePasswordHash(string $password, string $email): string
{
global $database; global $database;
$passwordHash = User::passwordToHash($password); $passwordHash = User::passwordToHash($password);
@ -378,10 +379,10 @@ class User
SET `password` = :password_hash SET `password` = :password_hash
WHERE `email` = :user_email', WHERE `email` = :user_email',
[ [
"user_email" => $email, "user_email" => $email,
"password_hash" => $passwordHash "password_hash" => $passwordHash,
] ]
); );
return $passwordHash; return $passwordHash;
} }
@ -416,7 +417,7 @@ class User
FROM `users` FROM `users`
WHERE `email` = :user_email', WHERE `email` = :user_email',
[ [
'user_email' => $email 'user_email' => $email,
] ]
) )
->fetch(\PDO::FETCH_ASSOC); ->fetch(\PDO::FETCH_ASSOC);
@ -439,7 +440,7 @@ class User
$password_matches = password_verify($password, $passwordHash); $password_matches = password_verify($password, $passwordHash);
if(!$password_matches) { if (!$password_matches) {
return false; return false;
} }
@ -452,7 +453,7 @@ class User
SET `last_login` = NOW() SET `last_login` = NOW()
WHERE `email` = :user_email', WHERE `email` = :user_email',
[ [
'user_email' => $email 'user_email' => $email,
] ]
); );
$user_database_fields['last_login'] = date('Y-m-d H:i'); $user_database_fields['last_login'] = date('Y-m-d H:i');