Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class CacheDatabaseException extends BaseException |
||
8 | { |
||
9 | |||
10 | /** @param string $before */ |
||
11 | private static string $before = "<Database Cache Store Exception>"; |
||
12 | |||
13 | /** |
||
14 | * @param string $message |
||
15 | * @param int $code |
||
16 | * @param Exception|null $previous |
||
17 | * @param array $details |
||
18 | * @return self |
||
19 | */ |
||
20 | public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
||
21 | { |
||
22 | return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
||
23 | } |
||
24 | |||
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | public static function getBefore(): string |
||
30 | { |
||
31 | return self::$before; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return void |
||
36 | */ |
||
37 | public static function setBefore(string $text): void |
||
38 | { |
||
39 | self::$before = $text; |
||
40 | } |
||
41 | |||
42 | /* |
||
43 | * @return array |
||
44 | */ |
||
45 | public function toArray() |
||
46 | { |
||
47 | return parent::toArray(); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function jsonSerialize(): array |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param int $options |
||
60 | * @return string |
||
61 | */ |
||
62 | public function toJson(int $options = 0) |
||
65 | } |
||
66 | } |
||
67 |