@@ -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); |
@@ -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 | } |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | * @param int|string $ttl |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function getCache(string $cacheKey, string $namespace = '', int|string $ttl = 3600) |
|
| 40 | + public function getCache(string $cacheKey, string $namespace = '', int | string $ttl = 3600) |
|
| 41 | 41 | { |
| 42 | 42 | $cacheData = $this->cacheer->cacheStore->getCache($cacheKey, $namespace, $ttl); |
| 43 | 43 | $this->cacheer->syncState(); |
| 44 | 44 | |
| 45 | - if ($this->cacheer->isSuccess() && ($this->cacheer->isCompressionEnabled() || $this->cacheer->getEncryptionKey() !== null)) { |
|
| 45 | + if ($this->cacheer->isSuccess() && ($this->cacheer->isCompressionEnabled() || $this->cacheer->getEncryptionKey() !== null)) { |
|
| 46 | 46 | $cacheData = CacheerHelper::recoverFromStorage($cacheData, $this->cacheer->isCompressionEnabled(), $this->cacheer->getEncryptionKey()); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param int|string $ttl |
| 58 | 58 | * @return array|CacheDataFormatter |
| 59 | 59 | */ |
| 60 | - public function getMany(array $cacheKeys, string $namespace = '', int|string $ttl = 3600) |
|
| 60 | + public function getMany(array $cacheKeys, string $namespace = '', int | string $ttl = 3600) |
|
| 61 | 61 | { |
| 62 | 62 | $cachedData = $this->cacheer->cacheStore->getMany($cacheKeys, $namespace, $ttl); |
| 63 | 63 | $this->cacheer->syncState(); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @param Closure $callback |
| 120 | 120 | * @return mixed |
| 121 | 121 | */ |
| 122 | - public function remember(string $cacheKey, int|string $ttl, Closure $callback) |
|
| 122 | + public function remember(string $cacheKey, int | string $ttl, Closure $callback) |
|
| 123 | 123 | { |
| 124 | 124 | $cachedData = $this->getCache($cacheKey, ttl: $ttl); |
| 125 | 125 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param int|string $ttl |
| 37 | 37 | * @return bool |
| 38 | 38 | */ |
| 39 | - public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600) |
|
| 39 | + public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
|
| 40 | 40 | { |
| 41 | 41 | if (!empty($this->cacheer->getCache($cacheKey, $namespace))) { |
| 42 | 42 | return true; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * @param int|string $ttl |
| 141 | 141 | * @return void |
| 142 | 142 | */ |
| 143 | - public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600) |
|
| 143 | + public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600) |
|
| 144 | 144 | { |
| 145 | 145 | $data = CacheerHelper::prepareForStorage($cacheData, $this->cacheer->isCompressionEnabled(), $this->cacheer->getEncryptionKey()); |
| 146 | 146 | $this->cacheer->cacheStore->putCache($cacheKey, $data, $namespace, $ttl); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * @param string $namespace |
| 169 | 169 | * @return void |
| 170 | 170 | */ |
| 171 | - public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = '') |
|
| 171 | + public function renewCache(string $cacheKey, int | string $ttl = 3600, string $namespace = '') |
|
| 172 | 172 | { |
| 173 | 173 | $this->cacheer->cacheStore->renewCache($cacheKey, $ttl, $namespace); |
| 174 | 174 | $this->cacheer->syncState(); |