@@ -7,33 +7,33 @@ |
||
7 | 7 | class CacheFileException extends BaseException |
8 | 8 | { |
9 | 9 | |
10 | - /** @param string $before */ |
|
11 | - private static string $before = "<File Cache Store Exception>"; |
|
12 | - |
|
13 | - /** |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | - { |
|
10 | + /** @param string $before */ |
|
11 | + private static string $before = "<File Cache Store Exception>"; |
|
12 | + |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
|
17 | + { |
|
18 | 18 | return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
19 | - } |
|
19 | + } |
|
20 | 20 | |
21 | 21 | |
22 | - /** |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public static function getBefore() |
|
26 | - { |
|
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public static function getBefore() |
|
26 | + { |
|
27 | 27 | return self::$before; |
28 | - } |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * @return void |
|
32 | - */ |
|
33 | - public static function setBefore(string $text) |
|
34 | - { |
|
30 | + /** |
|
31 | + * @return void |
|
32 | + */ |
|
33 | + public static function setBefore(string $text) |
|
34 | + { |
|
35 | 35 | self::$before = $text; |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
39 | 39 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
17 | 17 | { |
18 | - return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
|
18 | + return new self(self::getBefore() . ": " . $message, $code, $previous, $details); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * @param string $cacheKey |
|
52 | - * @param string $namespace |
|
53 | - * @return mixed |
|
54 | - */ |
|
51 | + * @param string $cacheKey |
|
52 | + * @param string $namespace |
|
53 | + * @return mixed |
|
54 | + */ |
|
55 | 55 | public function retrieve(string $cacheKey, string $namespace = '') |
56 | 56 | { |
57 | 57 | $driver = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME); |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
108 | - * @param string $cacheKey |
|
109 | - * @param string|int $ttl |
|
110 | - * @param string $namespace |
|
111 | - * @return bool |
|
112 | - */ |
|
108 | + * @param string $cacheKey |
|
109 | + * @param string|int $ttl |
|
110 | + * @param string $namespace |
|
111 | + * @return bool |
|
112 | + */ |
|
113 | 113 | public function renew(string $cacheKey, string|int $ttl, string $namespace = '') |
114 | 114 | { |
115 | 115 | $currentTime = date('Y-m-d H:i:s'); |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | - * @param string $driver |
|
167 | - * @return string |
|
168 | - */ |
|
166 | + * @param string $driver |
|
167 | + * @return string |
|
168 | + */ |
|
169 | 169 | private function getCurrentDateTime(string $driver) |
170 | 170 | { |
171 | 171 | return ($driver === 'sqlite') ? "DATETIME('now', 'localtime')" : "NOW()"; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string|int $ttl |
30 | 30 | * @return bool |
31 | 31 | */ |
32 | - public function store(string $cacheKey, mixed $cacheData, string $namespace, string|int $ttl = 3600) |
|
32 | + public function store(string $cacheKey, mixed $cacheData, string $namespace, string | int $ttl = 3600) |
|
33 | 33 | { |
34 | 34 | $expirationTime = date('Y-m-d H:i:s', time() + $ttl); |
35 | 35 | $createdAt = date('Y-m-d H:i:s'); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param string $namespace |
111 | 111 | * @return bool |
112 | 112 | */ |
113 | - public function renew(string $cacheKey, string|int $ttl, string $namespace = '') |
|
113 | + public function renew(string $cacheKey, string | int $ttl, string $namespace = '') |
|
114 | 114 | { |
115 | 115 | $currentTime = date('Y-m-d H:i:s'); |
116 | 116 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | SET expirationTime = DATE_ADD(expirationTime, INTERVAL ? SECOND) |
131 | 131 | WHERE cacheKey = ? AND cacheNamespace = ? AND expirationTime > ?" |
132 | 132 | ); |
133 | - $stmt->bindValue(1, (int) $ttl, PDO::PARAM_INT); |
|
133 | + $stmt->bindValue(1, (int)$ttl, PDO::PARAM_INT); |
|
134 | 134 | $stmt->bindValue(2, $cacheKey); |
135 | 135 | $stmt->bindValue(3, $namespace); |
136 | 136 | $stmt->bindValue(4, $currentTime); |