@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | public function test_remember_saves_and_recover_values() |
93 | 93 | { |
94 | 94 | $this->cache->flushCache(); |
95 | - $value = $this->cache->remember('remember_test_key', 60, function () { |
|
95 | + $value = $this->cache->remember('remember_test_key', 60, function() { |
|
96 | 96 | return 'valor_teste'; |
97 | 97 | }); |
98 | 98 | $this->assertEquals('valor_teste', $value); |
99 | - $cachedValue = $this->cache->remember('remember_test_key', 60, function(){ |
|
99 | + $cachedValue = $this->cache->remember('remember_test_key', 60, function() { |
|
100 | 100 | return 'novo_valor'; |
101 | 101 | }); |
102 | 102 | $this->assertEquals('valor_teste', $cachedValue); |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | public function test_remember_forever_saves_value_indefinitely() |
106 | 106 | { |
107 | 107 | $this->cache->flushCache(); |
108 | - $value = $this->cache->rememberForever('remember_forever_key', function () { |
|
108 | + $value = $this->cache->rememberForever('remember_forever_key', function() { |
|
109 | 109 | return 'valor_eterno'; |
110 | 110 | }); |
111 | 111 | $this->assertEquals('valor_eterno', $value); |
112 | - $cachedValue = $this->cache->rememberForever('remember_forever_key', function () { |
|
112 | + $cachedValue = $this->cache->rememberForever('remember_forever_key', function() { |
|
113 | 113 | return 'novo_valor'; |
114 | 114 | }); |
115 | 115 | $this->assertEquals('valor_eterno', $cachedValue); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $this->cacheer = $cacheer; |
15 | 15 | } |
16 | 16 | |
17 | - public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600) |
|
17 | + public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
|
18 | 18 | { |
19 | 19 | if (!empty($this->cacheer->getCache($cacheKey, $namespace))) { |
20 | 20 | return true; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | return false; |
69 | 69 | } |
70 | 70 | |
71 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): void |
|
71 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600): void |
|
72 | 72 | { |
73 | 73 | $data = CacheerHelper::prepareForStorage($cacheData, $this->cacheer->isCompressionEnabled(), $this->cacheer->getEncryptionKey()); |
74 | 74 | $this->cacheer->cacheStore->putCache($cacheKey, $data, $namespace, $ttl); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->cacheer->cacheStore->putMany($items, $namespace, $batchSize); |
81 | 81 | } |
82 | 82 | |
83 | - public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = ''): void |
|
83 | + public function renewCache(string $cacheKey, int | string $ttl = 3600, string $namespace = ''): void |
|
84 | 84 | { |
85 | 85 | $this->cacheer->cacheStore->renewCache($cacheKey, $ttl, $namespace); |
86 | 86 | $this->cacheer->syncState(); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $this->cacheer = $cacheer; |
17 | 17 | } |
18 | 18 | |
19 | - public function getCache(string $cacheKey, string $namespace = '', int|string $ttl = 3600) |
|
19 | + public function getCache(string $cacheKey, string $namespace = '', int | string $ttl = 3600) |
|
20 | 20 | { |
21 | 21 | $cacheData = $this->cacheer->cacheStore->getCache($cacheKey, $namespace, $ttl); |
22 | 22 | $this->cacheer->syncState(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return $this->cacheer->isFormatted() ? new CacheDataFormatter($cacheData) : $cacheData; |
29 | 29 | } |
30 | 30 | |
31 | - public function getMany(array $cacheKeys, string $namespace = '', int|string $ttl = 3600) |
|
31 | + public function getMany(array $cacheKeys, string $namespace = '', int | string $ttl = 3600) |
|
32 | 32 | { |
33 | 33 | $cachedData = $this->cacheer->cacheStore->getMany($cacheKeys, $namespace, $ttl); |
34 | 34 | $this->cacheer->syncState(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return null; |
70 | 70 | } |
71 | 71 | |
72 | - public function remember(string $cacheKey, int|string $ttl, Closure $callback) |
|
72 | + public function remember(string $cacheKey, int | string $ttl, Closure $callback) |
|
73 | 73 | { |
74 | 74 | $cachedData = $this->getCache($cacheKey, ttl: $ttl); |
75 | 75 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param int|string $ttl |
87 | 87 | * @return bool |
88 | 88 | */ |
89 | - public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600) |
|
89 | + public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
|
90 | 90 | { |
91 | 91 | return $this->mutator->add($cacheKey, $cacheData, $namespace, $ttl); |
92 | 92 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @param string|int $ttl |
183 | 183 | * @return CacheDataFormatter|mixed |
184 | 184 | */ |
185 | - public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600) |
|
185 | + public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600) |
|
186 | 186 | { |
187 | 187 | return $this->retriever->getCache($cacheKey, $namespace, $ttl); |
188 | 188 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param string|int $ttl |
196 | 196 | * @return CacheDataFormatter|mixed |
197 | 197 | */ |
198 | - public function getMany(array $cacheKeys, string $namespace = '', string|int $ttl = 3600) |
|
198 | + public function getMany(array $cacheKeys, string $namespace = '', string | int $ttl = 3600) |
|
199 | 199 | { |
200 | 200 | return $this->retriever->getMany($cacheKeys, $namespace, $ttl); |
201 | 201 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @param string|int $ttl |
245 | 245 | * @return void |
246 | 246 | */ |
247 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600): void |
|
247 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string | int $ttl = 3600): void |
|
248 | 248 | { |
249 | 249 | $this->mutator->putCache($cacheKey, $cacheData, $namespace, $ttl); |
250 | 250 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * @param string $namespace |
271 | 271 | * @return void |
272 | 272 | */ |
273 | - public function renewCache(string $cacheKey, string|int $ttl = 3600, string $namespace = ''): void |
|
273 | + public function renewCache(string $cacheKey, string | int $ttl = 3600, string $namespace = ''): void |
|
274 | 274 | { |
275 | 275 | $this->mutator->renewCache($cacheKey, $ttl, $namespace); |
276 | 276 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @param Closure $callback |
284 | 284 | * @return mixed |
285 | 285 | */ |
286 | - public function remember(string $cacheKey, int|string $ttl, Closure $callback) |
|
286 | + public function remember(string $cacheKey, int | string $ttl, Closure $callback) |
|
287 | 287 | { |
288 | 288 | return $this->retriever->remember($cacheKey, $ttl, $callback); |
289 | 289 | } |