Code Duplication    Length = 18-19 lines in 2 locations

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

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