Skip to content

Commit 60cdcbf

Browse files
chore: add typing to OC_User::getUser
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 716c47c commit 60cdcbf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/private/legacy/OC_User.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,14 @@ public static function isAdminUser($uid) {
306306
return $isAdmin && self::$incognitoMode === false;
307307
}
308308

309-
310309
/**
311-
* get the user id of the user currently logged in.
310+
* Get the user id of the user currently logged in unless in incognito mode.
312311
*
313-
* @return string|false uid or false
312+
* @return string|false User id if available; false otherwise.
314313
*/
315-
public static function getUser() {
314+
public static function getUser(): string|false {
316315
$uid = Server::get(ISession::class)?->get('user_id');
317-
if (!is_null($uid) && self::$incognitoMode === false) {
316+
if ($uid !== null && self::$incognitoMode === false) {
318317
return $uid;
319318
} else {
320319
return false;

0 commit comments

Comments
 (0)