Skip to content

Commit

Permalink
use empty() to simplify line 220
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed Apr 24, 2024
1 parent bcfb567 commit 8fcb843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static function getUserIdByEmail(string $email): ?int
$query = "SELECT user_id FROM user WHERE email = :email";
$result = self::query($query, ['email' => $email]);

if (!$result || count($result) == 0) {
if (empty($result)) {
return null;
}
return $result[0]->user_id;
Expand Down

0 comments on commit 8fcb843

Please sign in to comment.