Code Duplication    Length = 8-10 lines in 7 locations

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

@@ 82-91 (lines=10) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function loadUserBookmarks(int $userId, int $offset = 0, int $limit = -1): array
83
    {
84
        $this->logger->logCall(__METHOD__, [
85
            'userId' => $userId,
86
            'offset' => $offset,
87
            'limit' => $limit,
88
        ]);
89
90
        return $this->persistenceHandler->bookmarkHandler()->loadUserBookmarks($userId, $offset, $limit);
91
    }
92
93
    /**
94
     * {@inheritdoc}
@@ 54-61 (lines=8) @@
51
        return $this->getMultipleCacheItems(
52
            $locationIds,
53
            'ez-bookmark-' . $userId . '-',
54
            function (array $missingIds) use ($userId) {
55
                $this->logger->logCall(__CLASS__ . '::loadByUserIdAndLocationId', [
56
                    'userId' => $userId,
57
                    'locationIds' => $missingIds,
58
                ]);
59
60
                return $this->persistenceHandler->bookmarkHandler()->loadByUserIdAndLocationId($userId, $missingIds);
61
            },
62
            function (Bookmark $bookmark) {
63
                $tags = [
64
                    'bookmark-' . $bookmark->id,

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

@@ 154-163 (lines=10) @@
151
    /**
152
     * {@inheritdoc}
153
     */
154
    public function loadUserNotifications(int $userId, int $offset, int $limit): array
155
    {
156
        $this->logger->logCall(__METHOD__, [
157
            'ownerId' => $userId,
158
            'offset' => $offset,
159
            'limit' => $limit,
160
        ]);
161
162
        return $this->persistenceHandler->notificationHandler()->loadUserNotifications($userId, $offset, $limit);
163
    }
164
}
165

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

@@ 94-103 (lines=10) @@
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function loadUserPreferences(int $userId, int $offset, int $limit): array
95
    {
96
        $this->logger->logCall(__METHOD__, [
97
            'userId' => $userId,
98
            'offset' => $offset,
99
            'limit' => $limit,
100
        ]);
101
102
        return $this->persistenceHandler->userPreferenceHandler()->loadUserPreferences($userId, $offset, $limit);
103
    }
104
}
105

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

@@ 50-57 (lines=8) @@
47
        return $this->getMultipleCacheItems(
48
            $locationIds,
49
            'ez-location-',
50
            function (array $cacheMissIds) use ($translations, $useAlwaysAvailable) {
51
                $this->logger->logCall(
52
                    __CLASS__ . '::loadList',
53
                    ['location' => $cacheMissIds, 'translations' => $translations, 'always-available' => $useAlwaysAvailable]
54
                );
55
56
                return $this->persistenceHandler->locationHandler()->loadList($cacheMissIds, $translations, $useAlwaysAvailable);
57
            },
58
            function (Location $location) {
59
                return $this->getCacheTags($location);
60
            },
@@ 171-180 (lines=10) @@
168
    /**
169
     * {@inheritdoc}
170
     */
171
    public function copySubtree($sourceId, $destinationParentId, $newOwnerId = null)
172
    {
173
        $this->logger->logCall(__METHOD__, array(
174
            'source' => $sourceId,
175
            'destination' => $destinationParentId,
176
            'newOwner' => $newOwnerId,
177
        ));
178
179
        return $this->persistenceHandler->locationHandler()->copySubtree($sourceId, $destinationParentId, $newOwnerId);
180
    }
181
182
    /**
183
     * {@inheritdoc}

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

@@ 156-165 (lines=10) @@
153
    /**
154
     * {@inheritdoc}
155
     */
156
    public function delete($id)
157
    {
158
        $this->logger->logCall(__METHOD__, array('language' => $id));
159
        $return = $this->persistenceHandler->contentLanguageHandler()->delete($id);
160
161
        // As we don't have locale we clear cache by tag invalidation
162
        $this->invalidateCache(['language-' . $id]);
163
164
        return $return;
165
    }
166
}
167