diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-11-06 08:56:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-06 08:56:30 +0100 |
commit | d53fde8eef13d408fcf035ea8a95e6345df9b99b (patch) | |
tree | 60f6b612d967a9a264589cdd6cc0c6d008e1bf05 /core/Controller/TeamsApiController.php | |
parent | 8fab143aa486904f7a17c4f1c2f6364cd43bf9d9 (diff) | |
parent | 77114fb3277742fc69ddcf2432311ecb263af97e (diff) | |
download | nextcloud-server-d53fde8eef13d408fcf035ea8a95e6345df9b99b.tar.gz nextcloud-server-d53fde8eef13d408fcf035ea8a95e6345df9b99b.zip |
Merge pull request #49015 from nextcloud/fix/openapi/array-syntax
Diffstat (limited to 'core/Controller/TeamsApiController.php')
-rw-r--r-- | core/Controller/TeamsApiController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/Controller/TeamsApiController.php b/core/Controller/TeamsApiController.php index a27f6deff76..36685555d4d 100644 --- a/core/Controller/TeamsApiController.php +++ b/core/Controller/TeamsApiController.php @@ -36,7 +36,7 @@ class TeamsApiController extends \OCP\AppFramework\OCSController { * Get all resources of a team * * @param string $teamId Unique id of the team - * @return DataResponse<Http::STATUS_OK, array{resources: CoreTeamResource[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{resources: list<CoreTeamResource>}, array{}> * * 200: Resources returned */ @@ -44,7 +44,7 @@ class TeamsApiController extends \OCP\AppFramework\OCSController { #[ApiRoute(verb: 'GET', url: '/{teamId}/resources', root: '/teams')] public function resolveOne(string $teamId): DataResponse { /** - * @var CoreTeamResource[] $resolvedResources + * @var list<CoreTeamResource> $resolvedResources * @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */ $resolvedResources = $this->teamManager->getSharedWith($teamId, $this->userId); @@ -57,7 +57,7 @@ class TeamsApiController extends \OCP\AppFramework\OCSController { * * @param string $providerId Identifier of the provider (e.g. deck, talk, collectives) * @param string $resourceId Unique id of the resource to list teams for (e.g. deck board id) - * @return DataResponse<Http::STATUS_OK, array{teams: CoreTeam[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{teams: list<CoreTeam>}, array{}> * * 200: Teams returned */ @@ -66,13 +66,13 @@ class TeamsApiController extends \OCP\AppFramework\OCSController { 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); - /** @var CoreTeam[] $teams */ - $teams = array_map(function (Team $team) { + /** @var list<CoreTeam> $teams */ + $teams = array_values(array_map(function (Team $team) { $response = $team->jsonSerialize(); /** @psalm-suppress PossiblyNullArgument The route is limited to logged in users */ $response['resources'] = $this->teamManager->getSharedWith($team->getId(), $this->userId); return $response; - }, $teams); + }, $teams)); return new DataResponse([ 'teams' => $teams, |