From 8fcb84314fa0d0c35ba7da82c2e82749f9950a60 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:45:15 +0400 Subject: [PATCH] use empty() to simplify line 220 --- src/models/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/User.php b/src/models/User.php index a61706b..306619d 100644 --- a/src/models/User.php +++ b/src/models/User.php @@ -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;