Code Duplication    Length = 4-8 lines in 3 locations

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

@@ 128-131 (lines=4) @@
125
        // Get cache for published content types
126
        $cache = $this->cache->getItem('contentType', $typeId);
127
        $type = $cache->get();
128
        if ($cache->isMiss()) {
129
            $this->logger->logCall(__METHOD__, array('type' => $typeId, 'status' => $status));
130
            $cache->set($type = $this->persistenceHandler->contentTypeHandler()->load($typeId, $status))->save();
131
        }
132
133
        return $type;
134
    }

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

@@ 66-70 (lines=5) @@
63
        // Method caches all state groups in cache only uses offset / limit to slice the cached result
64
        $cache = $this->cache->getItem('objectstategroup', 'all');
65
        $stateGroups = $cache->get();
66
        if ($cache->isMiss()) {
67
            $this->logger->logCall(__METHOD__, array('offset' => $offset, 'limit' => $limit));
68
            $stateGroups = $this->persistenceHandler->objectStateHandler()->loadAllGroups(0, -1);
69
            $cache->set($stateGroups)->save();
70
        }
71
72
        return array_slice($stateGroups, $offset, $limit > -1 ?: null);
73
    }

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

@@ 199-206 (lines=8) @@
196
            $cache = $this->cache->getItem('user', 'role', 'assignments', 'byGroup', $groupId);
197
        }
198
        $assignments = $cache->get();
199
        if ($cache->isMiss()) {
200
            $this->logger->logCall(__METHOD__, array('group' => $groupId, 'inherit' => $inherit));
201
            $assignments = $this->persistenceHandler->userHandler()->loadRoleAssignmentsByGroupId(
202
                $groupId,
203
                $inherit
204
            );
205
            $cache->set($assignments)->save();
206
        }
207
208
        return $assignments;
209
    }