- added some type-hints
- added some documentation
- used self::exists() instead of DBA::exists('user', ['uid' => $uid])
This commit is contained in:
Roland Häder 2022-07-21 16:01:38 +02:00
parent a2a7d04fa1
commit ba1c1049d6
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
2 changed files with 68 additions and 41 deletions

View file

@ -276,7 +276,8 @@ class User
/**
* Returns true if a user record exists with the provided id
*
* @param integer $uid
* @param int $uid
*
* @return boolean
* @throws Exception
*/
@ -412,7 +413,7 @@ class User
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
if (!DBA::isResult($owner)) {
if (!DBA::exists('user', ['uid' => $uid]) || !$repairMissing) {
if (!self::exists($uid) || !$repairMissing) {
return false;
}
if (!DBA::exists('profile', ['uid' => $uid])) {