@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param string|int $ttl Lifetime in seconds (default: 3600) |
| 53 | 53 | * @return mixed Returns the cached data or null if not found |
| 54 | 54 | */ |
| 55 | - public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600); |
|
| 55 | + public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600); |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Retrieves multiple cache items by their keys. |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @param string|int $ttl Lifetime in seconds (default: 3600) |
| 63 | 63 | * @return CacheDataFormatter|mixed Returns a formatter with the retrieved items |
| 64 | 64 | */ |
| 65 | - public function getMany(array $cacheKeys, string $namespace, string|int $ttl = 3600); |
|
| 65 | + public function getMany(array $cacheKeys, string $namespace, string | int $ttl = 3600); |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Checks if a cache item exists. |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param string|int $ttl Lifetime in seconds (default: 3600) |
| 83 | 83 | * @return bool True on success, false on failure |
| 84 | 84 | */ |
| 85 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600); |
|
| 85 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600); |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Stores multiple items in the cache. |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * @param string|int $ttl |
| 179 | 179 | * @return string |
| 180 | 180 | */ |
| 181 | - public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600) |
|
| 181 | + public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600) |
|
| 182 | 182 | { |
| 183 | 183 | |
| 184 | 184 | $ttl = CacheFileHelper::ttl($ttl, $this->defaultTTL); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | * @param string|int $ttl |
| 264 | 264 | * @return mixed |
| 265 | 265 | */ |
| 266 | - public function getMany(array $cacheKeys, string $namespace = '', string|int $ttl = 3600) |
|
| 266 | + public function getMany(array $cacheKeys, string $namespace = '', string | int $ttl = 3600) |
|
| 267 | 267 | { |
| 268 | 268 | $ttl = CacheFileHelper::ttl($ttl, $this->defaultTTL); |
| 269 | 269 | $results = []; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * @param string|int $ttl |
| 310 | 310 | * @return void |
| 311 | 311 | */ |
| 312 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600) |
|
| 312 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string | int $ttl = 3600) |
|
| 313 | 313 | { |
| 314 | 314 | $cacheFile = $this->buildCacheFilePath($cacheKey, $namespace); |
| 315 | 315 | $data = $this->fileManager->serialize($cacheData); |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * @param string $namespace |
| 347 | 347 | * @return void |
| 348 | 348 | */ |
| 349 | - public function renewCache(string $cacheKey, string|int $ttl, string $namespace = '') |
|
| 349 | + public function renewCache(string $cacheKey, string | int $ttl, string $namespace = '') |
|
| 350 | 350 | { |
| 351 | 351 | $cacheData = $this->getCache($cacheKey, $namespace); |
| 352 | 352 | if ($cacheData) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param int|string $ttl |
| 80 | 80 | * @return bool |
| 81 | 81 | */ |
| 82 | - public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600) |
|
| 82 | + public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
|
| 83 | 83 | { |
| 84 | 84 | if (!empty($this->getCache($cacheKey, $namespace))) { |
| 85 | 85 | return true; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * @param string|int $ttl |
| 204 | 204 | * @return CacheDataFormatter|mixed |
| 205 | 205 | */ |
| 206 | - public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600) |
|
| 206 | + public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600) |
|
| 207 | 207 | { |
| 208 | 208 | $cacheData = $this->cacheStore->getCache($cacheKey, $namespace, $ttl); |
| 209 | 209 | $this->setMessage($this->cacheStore->getMessage(), $this->cacheStore->isSuccess()); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @param string|int $ttl |
| 224 | 224 | * @return CacheDataFormatter|mixed |
| 225 | 225 | */ |
| 226 | - public function getMany(array $cacheKeys, string $namespace = '', string|int $ttl = 3600) |
|
| 226 | + public function getMany(array $cacheKeys, string $namespace = '', string | int $ttl = 3600) |
|
| 227 | 227 | { |
| 228 | 228 | $cachedData = $this->cacheStore->getMany($cacheKeys, $namespace, $ttl); |
| 229 | 229 | $this->setMessage($this->cacheStore->getMessage(), $this->cacheStore->isSuccess()); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | { |
| 263 | 263 | $cacheData = $this->getCache($cacheKey, $namespace); |
| 264 | 264 | |
| 265 | - if(!empty($cacheData) && is_numeric($cacheData)) { |
|
| 265 | + if (!empty($cacheData) && is_numeric($cacheData)) { |
|
| 266 | 266 | $this->putCache($cacheKey, (int)($cacheData + $amount), $namespace); |
| 267 | 267 | $this->setMessage($this->getMessage(), $this->isSuccess()); |
| 268 | 268 | return true; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * @param string|int $ttl |
| 291 | 291 | * @return void |
| 292 | 292 | */ |
| 293 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600) |
|
| 293 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string | int $ttl = 3600) |
|
| 294 | 294 | { |
| 295 | 295 | $data = CacheerHelper::prepareForStorage($cacheData, $this->compression, $this->encryptionKey); |
| 296 | 296 | $this->cacheStore->putCache($cacheKey, $data, $namespace, $ttl); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @param string $namespace |
| 319 | 319 | * @return void |
| 320 | 320 | */ |
| 321 | - public function renewCache(string $cacheKey, string|int $ttl = 3600, string $namespace = '') |
|
| 321 | + public function renewCache(string $cacheKey, string | int $ttl = 3600, string $namespace = '') |
|
| 322 | 322 | { |
| 323 | 323 | $this->cacheStore->renewCache($cacheKey, $ttl, $namespace); |
| 324 | 324 | |
@@ -337,11 +337,11 @@ discard block |
||
| 337 | 337 | * @param Closure $callback |
| 338 | 338 | * @return mixed |
| 339 | 339 | */ |
| 340 | - public function remember(string $cacheKey, int|string $ttl, Closure $callback) |
|
| 340 | + public function remember(string $cacheKey, int | string $ttl, Closure $callback) |
|
| 341 | 341 | { |
| 342 | 342 | $cachedData = $this->getCache($cacheKey, ttl: $ttl); |
| 343 | 343 | |
| 344 | - if(!empty($cachedData)) { |
|
| 344 | + if (!empty($cachedData)) { |
|
| 345 | 345 | return $cachedData; |
| 346 | 346 | } |
| 347 | 347 | |