mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
refactor: Make some code a bit more correct
- Use PHP_FLOAT_EPSILON for float comparaison - Simplify some getValueBool code Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
parent
0744d1cf6b
commit
1661855f5b
2 changed files with 3 additions and 3 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue