Code Duplication    Length = 9-14 lines in 4 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->deleteItems([
51
            'ez-notification-' . $notification->id,
52
            'ez-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->deleteItems([
68
            'ez-notification-' . $notification->id,
69
            'ez-notification-count-' . $notification->ownerId,
70
            'ez-notification-pending-count-' . $notification->ownerId,
71
        ]);
72
73
        $this->persistenceHandler->notificationHandler()->delete($notification);
74
    }
75
76
    /**
77
     * {@inheritdoc}

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

@@ 462-470 (lines=9) @@
459
    /**
460
     * {@inheritdoc}
461
     */
462
    public function updatePolicy(Policy $policy)
463
    {
464
        $this->logger->logCall(__METHOD__, ['struct' => $policy]);
465
        $return = $this->persistenceHandler->userHandler()->updatePolicy($policy);
466
467
        $this->cache->invalidateTags(['policy-' . $policy->id, 'role-' . $policy->roleId]);
468
469
        return $return;
470
    }
471
472
    /**
473
     * {@inheritdoc}

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

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