Code Duplication    Length = 18-19 lines in 2 locations

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

@@ 258-275 (lines=18) @@
255
    /**
256
     * {@inheritdoc}
257
     */
258
    public function loadRole($roleId, $status = Role::STATUS_DEFINED)
259
    {
260
        if ($status !== Role::STATUS_DEFINED) {
261
            $this->logger->logCall(__METHOD__, array('role' => $roleId));
262
263
            return $this->persistenceHandler->userHandler()->loadRole($roleId, $status);
264
        }
265
266
        return $this->getCacheValue(
267
            $roleId,
268
            'ez-role-',
269
            function ($roleId) {
270
                return $this->persistenceHandler->userHandler()->loadRole($roleId);
271
            },
272
            $this->getRoleTags,
273
            $this->getRoleKeys
274
        );
275
    }
276
277
    /**
278
     * {@inheritdoc}
@@ 280-298 (lines=19) @@
277
    /**
278
     * {@inheritdoc}
279
     */
280
    public function loadRoleByIdentifier($identifier, $status = Role::STATUS_DEFINED)
281
    {
282
        if ($status !== Role::STATUS_DEFINED) {
283
            $this->logger->logCall(__METHOD__, array('role' => $identifier));
284
285
            return $this->persistenceHandler->userHandler()->loadRoleByIdentifier($identifier, $status);
286
        }
287
288
        return $this->getCacheValue(
289
            $identifier,
290
            'ez-role-',
291
            function ($identifier) {
292
                return $this->persistenceHandler->userHandler()->loadRoleByIdentifier($identifier);
293
            },
294
            $this->getRoleTags,
295
            $this->getRoleKeys,
296
            '-by-identifier'
297
        );
298
    }
299
300
    /**
301
     * {@inheritdoc}