Code Duplication    Length = 13-14 lines in 3 locations

eZ/Publish/Core/Persistence/Cache/NotificationHandler.php 2 locations

@@ 44-56 (lines=13) @@
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function updateNotification(APINotification $notification, UpdateStruct $updateStruct): Notification
45
    {
46
        $this->logger->logCall(__METHOD__, [
47
            'notificationId' => $notification->id,
48
        ]);
49
50
        $this->cache->invalidateTags([
51
            'notification-' . $notification->id,
52
            'notification-pending-count-' . $notification->ownerId,
53
        ]);
54
55
        return $this->persistenceHandler->notificationHandler()->updateNotification($notification, $updateStruct);
56
    }
57
58
    /**
59
     * {@inheritdoc}
@@ 61-74 (lines=14) @@
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function delete(APINotification $notification): void
62
    {
63
        $this->logger->logCall(__METHOD__, [
64
            'notificationId' => $notification->id,
65
        ]);
66
67
        $this->cache->invalidateTags([
68
            'notification-' . $notification->id,
69
            'notification-count-' . $notification->ownerId,
70
            'notification-pending-count-' . $notification->ownerId,
71
        ]);
72
73
        $this->persistenceHandler->notificationHandler()->delete($notification);
74
    }
75
76
    /**
77
     * {@inheritdoc}

eZ/Publish/Core/Persistence/Cache/UserPreferenceHandler.php 1 location

@@ 25-37 (lines=13) @@
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function setUserPreference(UserPreferenceSetStruct $setStruct): UserPreference
26
    {
27
        $this->logger->logCall(__METHOD__, [
28
            'setStruct' => $setStruct,
29
        ]);
30
31
        $this->cache->invalidateTags([
32
            'user-preference-count-' . $setStruct->userId,
33
            'user-preference-' . $setStruct->userId . '-' . $setStruct->name,
34
        ]);
35
36
        return $this->persistenceHandler->userPreferenceHandler()->setUserPreference($setStruct);
37
    }
38
39
    /**
40
     * {@inheritdoc}