refactor: improve code quality and doc block in PersonalInfo

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Cristian Scheid <74515775+cristianscheid@users.noreply.github.com>
This commit is contained in:
Cristian Scheid 2026-01-08 14:56:36 -03:00 committed by nextcloud-command
parent 7e1b5af9e8
commit a109ed365f

View file

@ -197,18 +197,16 @@ class PersonalInfo implements ISettings {
}
/**
* returns a sorted list of the user's team memberships
* returns a list of the user's team memberships, sorted alphabetically
* @return list<string> team names
*/
private function getTeamMemberships(IUser $user): array {
$circlesEnabled = $this->appManager->isEnabledForUser('circles');
if (!$circlesEnabled) {
if (!$this->appManager->isEnabledForUser('circles')) {
return [];
}
$teams = array_map(
static function (Team $team) {
return $team->getDisplayName();
},
static fn (Team $team): string => $team->getDisplayName(),
$this->teamManager->getMemberships($user->getUID())
);
sort($teams);