Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(docs): Fix returned notification list type
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Dec 8, 2023
commit 282391d5f6a941f6617187042b864cdcde119642
2 changes: 1 addition & 1 deletion lib/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function confirmIdsForUser(string $user, array $ids): array {
* @param int $startAfterId
* @param string $userId
* @param int $limit
* @return array [notification_id => INotification]
* @return array<int, INotification> [notification_id => INotification]
*/
public function getAfterId(int $startAfterId, string $userId, int $limit = 25): array {
$sql = $this->connection->getQueryBuilder();
Expand Down
6 changes: 3 additions & 3 deletions lib/MailNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function sendEmails(int $batchSize, int $sendTime): void {
$languageCode = $userLanguages[$settings->getUserId()] ?? $fallbackLang;
$timezone = $userTimezones[$settings->getUserId()] ?? $fallbackTimeZone;

/** @var INotification[] $notifications */
/** @var array<int, INotification> $notifications */
$notifications = $this->handler->getAfterId($settings->getLastSendId(), $settings->getUserId());
if (!empty($notifications)) {
$oldestNotification = end($notifications);
Expand All @@ -183,10 +183,10 @@ public function sendEmails(int $batchSize, int $sendTime): void {
}

/**
* send an email to the user containing given list of notifications
* Send an email to the user containing given list of notifications
*
* @param Settings $settings
* @param INotification[] $notifications
* @param non-empty-array<int, INotification> $notifications
* @param string $language
* @param string $timezone
*/
Expand Down