diff --git a/lib/Capabilities.php b/lib/Capabilities.php index 4a128f891..984e86240 100644 --- a/lib/Capabilities.php +++ b/lib/Capabilities.php @@ -23,9 +23,9 @@ class Capabilities implements ICapability { * * @return array{ * notifications: array{ - * ocs-endpoints: string[], - * push: string[], - * admin-notifications: string[], + * ocs-endpoints: list, + * push: list, + * admin-notifications: list, * }, * } */ diff --git a/lib/Controller/APIController.php b/lib/Controller/APIController.php index f132df148..07f41182a 100644 --- a/lib/Controller/APIController.php +++ b/lib/Controller/APIController.php @@ -49,7 +49,7 @@ public function __construct( * @param string $userId ID of the user * @param string $shortMessage Subject of the notification * @param string $longMessage Message of the notification - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * @deprecated 30.0.0 * * 200: Notification generated successfully diff --git a/lib/Controller/EndpointController.php b/lib/Controller/EndpointController.php index c23ed6f18..2da411929 100644 --- a/lib/Controller/EndpointController.php +++ b/lib/Controller/EndpointController.php @@ -56,7 +56,7 @@ public function __construct( * Get all notifications * * @param string $apiVersion Version of the API to use - * @return DataResponse|DataResponse + * @return DataResponse, array{'X-Nextcloud-User-Status': string}>|DataResponse * * 200: Notifications returned * 204: No app uses notifications @@ -175,8 +175,8 @@ public function getNotification(string $apiVersion, int $id): DataResponse { * Check if notification IDs exist * * @param string $apiVersion Version of the API to use - * @param int[] $ids IDs of the notifications to check - * @return DataResponse + * @param list $ids IDs of the notifications to check + * @return DataResponse, array{}> * * 200: Existing notification IDs returned * 400: Too many notification IDs requested @@ -195,10 +195,10 @@ public function confirmIdsForUser(string $apiVersion, array $ids): DataResponse return new DataResponse([], Http::STATUS_BAD_REQUEST); } - $ids = array_unique(array_filter(array_map( + $ids = array_values(array_unique(array_filter(array_map( static fn ($id) => is_numeric($id) ? (int)$id : 0, $ids - ))); + )))); $existingIds = $this->handler->confirmIdsForUser($this->getCurrentUser(), $ids); return new DataResponse($existingIds, Http::STATUS_OK); @@ -208,7 +208,7 @@ public function confirmIdsForUser(string $apiVersion, array $ids): DataResponse * Delete a notification * * @param int $id ID of the notification - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: Notification deleted successfully * 403: Deleting notification for impersonated user is not allowed @@ -240,7 +240,7 @@ public function deleteNotification(int $id): DataResponse { /** * Delete all notifications * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: All notifications deleted successfully * 403: Deleting notification for impersonated user is not allowed diff --git a/lib/Controller/PushController.php b/lib/Controller/PushController.php index 26957bc22..4fac070ce 100644 --- a/lib/Controller/PushController.php +++ b/lib/Controller/PushController.php @@ -50,7 +50,7 @@ public function __construct( * @param string $pushTokenHash Hash of the push token * @param string $devicePublicKey Public key of the device * @param string $proxyServer Proxy server to be used - * @return DataResponse|DataResponse|DataResponse, array{}> + * @return DataResponse|DataResponse|DataResponse, array{}> * * 200: Device was already registered * 201: Device registered successfully @@ -131,7 +131,7 @@ public function registerDevice(string $pushTokenHash, string $devicePublicKey, s /** * Remove a device from push notifications * - * @return DataResponse, array{}>|DataResponse + * @return DataResponse, array{}>|DataResponse * * 200: No device registered * 202: Device removed successfully diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 0327cfc08..7b7a295ae 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -36,7 +36,7 @@ public function __construct( * @param int $batchSetting How often E-mails about missed notifications should be sent (hourly: 1; every three hours: 2; daily: 3; weekly: 4) * @param string $soundNotification Enable sound for notifications ('yes' or 'no') * @param string $soundTalk Enable sound for Talk notifications ('yes' or 'no') - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Personal settings updated */ @@ -57,7 +57,7 @@ public function personal(int $batchSetting, string $soundNotification, string $s * @param int $batchSetting How often E-mails about missed notifications should be sent (hourly: 1; every three hours: 2; daily: 3; weekly: 4) * @param string $soundNotification Enable sound for notifications ('yes' or 'no') * @param string $soundTalk Enable sound for Talk notifications ('yes' or 'no') - * @return DataResponse, array{}> + * @return DataResponse, array{}> * * 200: Admin settings updated */ diff --git a/lib/Handler.php b/lib/Handler.php index a78e3aac1..b69246d76 100644 --- a/lib/Handler.php +++ b/lib/Handler.php @@ -183,8 +183,8 @@ public function getById(int $id, string $user): INotification { /** * Confirm that the notification ids still exist for the user * - * @param int[] $ids - * @return int[] + * @param list $ids + * @return list */ public function confirmIdsForUser(string $user, array $ids): array { $query = $this->connection->getQueryBuilder(); diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index e5cf665c1..fabe09e48 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -57,7 +57,7 @@ * subject: string, * message: string, * link: string, - * actions: NotificationsNotificationAction[], + * actions: list, * subjectRich?: string, * subjectRichParameters?: array, * messageRich?: string,