diff --git a/core/Controller/TeamsApiController.php b/core/Controller/TeamsApiController.php index 1dfe640964faa..ca507df5894ff 100644 --- a/core/Controller/TeamsApiController.php +++ b/core/Controller/TeamsApiController.php @@ -65,8 +65,8 @@ public function resolveOne(string $teamId): DataResponse { public function listTeams(string $providerId, string $resourceId): DataResponse { /** @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */ $teams = $this->teamManager->getTeamsForResource($providerId, $resourceId, $this->userId); - $sharesPerTeams = $this->teamManager->getSharedWithList(array_map(fn (Team $team): string => $team->getId(), $teams), $this->userId); - $listTeams = array_values(array_map(function (Team $team) use ($sharesPerTeams) { + $sharesPerTeams = $this->teamManager->getSharedWithList(array_map(static fn (Team $team): string => $team->getId(), $teams), $this->userId); + $listTeams = array_values(array_map(static function (Team $team) use ($sharesPerTeams) { $response = $team->jsonSerialize(); /** @psalm-suppress PossiblyNullArgument The route is limited to logged in users */ $response['resources'] = array_map(static fn (TeamResource $resource) => $resource->jsonSerialize(), $sharesPerTeams[$team->getId()] ?? []); diff --git a/lib/private/Teams/TeamManager.php b/lib/private/Teams/TeamManager.php index 9cf7d779fc23a..2bbf85e7d3688 100644 --- a/lib/private/Teams/TeamManager.php +++ b/lib/private/Teams/TeamManager.php @@ -94,7 +94,7 @@ public function getSharedWithList(array $teams, string $userId): array { $resources[] = $provider->getSharedWithList($teams, $userId); } else { foreach ($teams as $team) { - $resources[] = [$team->getId() => $provider->getSharedWith($team->getId())]; + $resources[] = [$team => $provider->getSharedWith($team)]; } } } diff --git a/lib/public/Teams/ITeamManager.php b/lib/public/Teams/ITeamManager.php index 68fe7dc735419..0d355ddd138a9 100644 --- a/lib/public/Teams/ITeamManager.php +++ b/lib/public/Teams/ITeamManager.php @@ -41,7 +41,7 @@ public function getSharedWith(string $teamId, string $userId): array; public function getTeamsForResource(string $providerId, string $resourceId, string $userId): array; /** - * @param list $teams + * @param string[] $teams * @return array> * * @since 31.0.11