From 1661855f5bbbfbbc7643ddecc6b00ef7a53f35f7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 11 Dec 2025 12:35:14 +0100 Subject: [PATCH] refactor: Make some code a bit more correct - Use PHP_FLOAT_EPSILON for float comparaison - Simplify some getValueBool code Signed-off-by: Carl Schwan --- apps/user_ldap/lib/User/DeletedUsersIndex.php | 2 +- apps/weather_status/lib/Service/WeatherStatusService.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/user_ldap/lib/User/DeletedUsersIndex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php index 55f2b764bc4..dd05af7f01a 100644 --- a/apps/user_ldap/lib/User/DeletedUsersIndex.php +++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php @@ -85,6 +85,6 @@ class DeletedUsersIndex { } public function isUserMarked(string $ocName): bool { - return ($this->userConfig->getValueBool($ocName, 'user_ldap', 'isDeleted', false) === true); + return $this->userConfig->getValueBool($ocName, 'user_ldap', 'isDeleted'); } } diff --git a/apps/weather_status/lib/Service/WeatherStatusService.php b/apps/weather_status/lib/Service/WeatherStatusService.php index f5a986904ab..c2856ab611e 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -285,8 +285,8 @@ class WeatherStatusService { $address = $this->userConfig->getValueString($this->userId, Application::APP_ID, 'address'); $mode = $this->userConfig->getValueInt($this->userId, Application::APP_ID, 'mode', self::MODE_MANUAL_LOCATION); return [ - 'lat' => $lat === 0.0 ? '' : (string)$lat, - 'lon' => $lon === 0.0 ? '' : (string)$lon, + 'lat' => abs($lat) < PHP_FLOAT_EPSILON ? '' : (string)$lat, + 'lon' => abs($lon) < PHP_FLOAT_EPSILON ? '' : (string)$lon, 'address' => $address, 'mode' => $mode, ];