Code Duplication    Length = 11-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/LocationHandler.php 1 location

@@ 327-337 (lines=11) @@
324
    /**
325
     * {@inheritdoc}
326
     */
327
    public function create(CreateStruct $locationStruct)
328
    {
329
        $this->logger->logCall(__METHOD__, array('struct' => $locationStruct));
330
        $location = $this->persistenceHandler->locationHandler()->create($locationStruct);
331
332
        // need to clear loadLocationsByContent and similar collections involving locations data
333
        // also need to clear content info on main location changes
334
        $this->cache->invalidateTags(['content-' . $locationStruct->contentId, 'role-assignment-group-list-' . $locationStruct->contentId]);
335
336
        return $location;
337
    }
338
339
    /**
340
     * {@inheritdoc}