diff --git a/src/Dal/UserDal.php b/src/Dal/UserDal.php index 17e2871..e8949f2 100644 --- a/src/Dal/UserDal.php +++ b/src/Dal/UserDal.php @@ -30,7 +30,7 @@ public static function create(UserEntity $userEntity): string|false try { $redBeanIncrementId = R::store($userBean); - } catch (SQL $e) { + } catch (SQL) { // since PHP 8, we can omit the caught variable (e.g. SQL $e) return false; } finally { R::close(); @@ -68,7 +68,7 @@ public static function update(string $userUuid, UserEntity $userEntity): int|str // attempt to save the user try { return R::store($userBean); // returns the user ID - } catch (SQL $e) { + } catch (SQL) { // PHP >=8.0 allows to omit the caught variable (e.g. SQL $e) return false; } finally { R::close(); diff --git a/src/Service/User.php b/src/Service/User.php index 84caa17..3e2a974 100644 --- a/src/Service/User.php +++ b/src/Service/User.php @@ -59,7 +59,7 @@ public function login(mixed $data): array try { UserDal::setToken($jwtToken, $user->getUserUuid()); - } catch (Exception $e) { + } catch (Exception) { // since PHP 8.0, we can omit the caught variable name (e.g. Exception $e) throw new CannotLoginUserException('Cannot set token to user'); }