Code Duplication    Length = 10-10 lines in 6 locations

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/ExceptionConversion.php 4 locations

@@ 247-256 (lines=10) @@
244
     * @param string $action
245
     * @param mixed|null $id
246
     */
247
    public function remove($action, $id = null)
248
    {
249
        try {
250
            $this->innerGateway->remove($action, $id);
251
        } catch (DBALException $e) {
252
            throw new \RuntimeException('Database error', 0, $e);
253
        } catch (PDOException $e) {
254
            throw new \RuntimeException('Database error', 0, $e);
255
        }
256
    }
257
258
    /**
259
     * Loads paged list of global aliases.
@@ 37-46 (lines=10) @@
34
        $this->innerGateway = $innerGateway;
35
    }
36
37
    public function setTable($name)
38
    {
39
        try {
40
            return $this->innerGateway->setTable($name);
41
        } catch (DBALException $e) {
42
            throw new \RuntimeException('Database error', 0, $e);
43
        } catch (PDOException $e) {
44
            throw new \RuntimeException('Database error', 0, $e);
45
        }
46
    }
47
48
    /**
49
     * Loads list of aliases by given $locationId.
@@ 113-122 (lines=10) @@
110
        }
111
    }
112
113
    public function historizeBeforeSwap($action, $languageMask)
114
    {
115
        try {
116
            $this->innerGateway->historizeBeforeSwap($action, $languageMask);
117
        } catch (DBALException $e) {
118
            throw new \RuntimeException('Database error', 0, $e);
119
        } catch (PDOException $e) {
120
            throw new \RuntimeException('Database error', 0, $e);
121
        }
122
    }
123
124
    /**
125
     * Marks all entries with given $id as history entries.
@@ 393-402 (lines=10) @@
390
        }
391
    }
392
393
    public function getLocationContentMainLanguageId($locationId)
394
    {
395
        try {
396
            return $this->innerGateway->getLocationContentMainLanguageId($locationId);
397
        } catch (DBALException $e) {
398
            throw new \RuntimeException('Database error', 0, $e);
399
        } catch (PDOException $e) {
400
            throw new \RuntimeException('Database error', 0, $e);
401
        }
402
    }
403
}
404

eZ/Publish/Core/Persistence/Legacy/User/Gateway/ExceptionConversion.php 1 location

@@ 116-125 (lines=10) @@
113
     *
114
     * @return array
115
     */
116
    public function loadByEmail($email)
117
    {
118
        try {
119
            return $this->innerGateway->loadByEmail($email);
120
        } catch (\DBALException $e) {
121
            throw new \RuntimeException('Database error', 0, $e);
122
        } catch (\PDOException $e) {
123
            throw new \RuntimeException('Database error', 0, $e);
124
        }
125
    }
126
127
    /**
128
     * Update the user information specified by the user struct.

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/ExceptionConversion.php 1 location

@@ 375-384 (lines=10) @@
372
     *
373
     * @return string[][]
374
     */
375
    public function listVersions($contentId, $status = null, $limit = -1)
376
    {
377
        try {
378
            return $this->innerGateway->listVersions($contentId, $status, $limit);
379
        } catch (DBALException $e) {
380
            throw new RuntimeException('Database error', 0, $e);
381
        } catch (PDOException $e) {
382
            throw new RuntimeException('Database error', 0, $e);
383
        }
384
    }
385
386
    /**
387
     * Returns all version numbers for the given $contentId.