Skip to content

Commit 1c05760

Browse files
committed
IBX-9060: Refactored after review
1 parent 8414b4a commit 1c05760

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/Persistence/Cache/NotificationHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function bulkUpdateUserNotifications(
5454
->bulkUpdateUserNotifications($ownerId, $updateStruct, $pendingOnly, $notificationIds);
5555

5656
$cacheKeys = array_map(
57-
fn (int $id) => $this->cacheIdentifierGenerator->generateKey(self::NOTIFICATION_IDENTIFIER, [$id], true),
57+
fn (int $id): string => $this->cacheIdentifierGenerator->generateKey(self::NOTIFICATION_IDENTIFIER, [$id], true),
5858
$updatedNotificationIds
5959
);
6060

src/lib/Persistence/Legacy/Notification/Gateway/DoctrineDatabase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function bulkUpdateUserNotifications(
9292
bool $pendingOnly = false,
9393
array $notificationIds = []
9494
): array {
95-
if (!is_int($notification->ownerId) || $notification->ownerId <= 0) {
95+
if (!is_int($notification->ownerId)) {
9696
throw new InvalidArgumentException('ownerId', 'Cannot bulk update notifications without valid ownerId');
9797
}
9898

@@ -101,7 +101,7 @@ public function bulkUpdateUserNotifications(
101101
->select(self::COLUMN_ID)
102102
->from(self::TABLE_NOTIFICATION)
103103
->andWhere($queryBuilder->expr()->eq(self::COLUMN_OWNER_ID, ':ownerId'))
104-
->setParameter(':ownerId', $notification->ownerId, PDO::PARAM_INT);
104+
->setParameter(':ownerId', $notification->ownerId, ParameterType::INTEGER);
105105

106106
if ($pendingOnly) {
107107
$queryBuilder->andWhere($queryBuilder->expr()->eq(self::COLUMN_IS_PENDING, ':isPendingFlag'))

0 commit comments

Comments
 (0)