mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
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:
parent
7e1b5af9e8
commit
a109ed365f
1 changed files with 4 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue