@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param string|int $ttl |
73 | 73 | * @return string|null |
74 | 74 | */ |
75 | - public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600) |
|
75 | + public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600) |
|
76 | 76 | { |
77 | 77 | |
78 | 78 | $ttl = CacheFileHelper::ttl($ttl, $this->defaultTTL); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string|int $ttl |
98 | 98 | * @return void |
99 | 99 | */ |
100 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600) |
|
100 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string | int $ttl = 3600) |
|
101 | 101 | { |
102 | 102 | $cacheFile = $this->buildCacheFilePath($cacheKey, $namespace); |
103 | 103 | $data = $this->fileManager->serialize($cacheData); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param string $namespace |
172 | 172 | * @return void |
173 | 173 | */ |
174 | - public function renewCache(string $cacheKey, string|int $ttl, string $namespace = '') |
|
174 | + public function renewCache(string $cacheKey, string | int $ttl, string $namespace = '') |
|
175 | 175 | { |
176 | 176 | $cacheData = $this->getCache($cacheKey, $namespace); |
177 | 177 | if ($cacheData) { |
@@ -278,12 +278,12 @@ discard block |
||
278 | 278 | { |
279 | 279 | $flushAfterSeconds = CacheFileHelper::convertExpirationToSeconds($flushAfter); |
280 | 280 | |
281 | - if(!$this->fileManager->fileExists($this->lastFlushTimeFile)) { |
|
281 | + if (!$this->fileManager->fileExists($this->lastFlushTimeFile)) { |
|
282 | 282 | $this->fileManager->writeFile($this->lastFlushTimeFile, time()); |
283 | 283 | return; |
284 | 284 | } |
285 | 285 | |
286 | - $lastFlushTime = (int) $this->fileManager->readFile($this->lastFlushTimeFile); |
|
286 | + $lastFlushTime = (int)$this->fileManager->readFile($this->lastFlushTimeFile); |
|
287 | 287 | |
288 | 288 | if ((time() - $lastFlushTime) >= $flushAfterSeconds) { |
289 | 289 | $this->flushCache(); |