@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $Cacheer->putCache($cacheKey, $userProfile, ttl: 300); |
| 20 | 20 | |
| 21 | 21 | // Recuperando dados do cache |
| 22 | -if($Cacheer->isSuccess()){ |
|
| 22 | +if ($Cacheer->isSuccess()) { |
|
| 23 | 23 | echo "Cache Found: "; |
| 24 | 24 | print_r($Cacheer->getCache($cacheKey)); |
| 25 | 25 | } else { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | // Renovando os dados do cache |
| 30 | 30 | $Cacheer->renewCache($cacheKey, 3600); |
| 31 | 31 | |
| 32 | -if($Cacheer->isSuccess()){ |
|
| 32 | +if ($Cacheer->isSuccess()) { |
|
| 33 | 33 | echo $Cacheer->getMessage() . PHP_EOL; |
| 34 | 34 | } else { |
| 35 | 35 | echo $Cacheer->getMessage() . PHP_EOL; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $Cacheer->putCache($cacheKey, $userProfile); |
| 26 | 26 | |
| 27 | 27 | // Recuperando dados do cache |
| 28 | -if($Cacheer->isSuccess()){ |
|
| 28 | +if ($Cacheer->isSuccess()) { |
|
| 29 | 29 | echo "Cache Found: "; |
| 30 | 30 | print_r($Cacheer->getCache($cacheKey)); |
| 31 | 31 | } else { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // Mesclando os dados |
| 37 | 37 | $Cacheer->appendCache($cacheKey, $userProfile02); |
| 38 | 38 | |
| 39 | -if($Cacheer->isSuccess()){ |
|
| 39 | +if ($Cacheer->isSuccess()) { |
|
| 40 | 40 | echo $Cacheer->getMessage() . PHP_EOL; |
| 41 | 41 | print_r($Cacheer->getCache($cacheKey)); |
| 42 | 42 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return $this; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return new TimeBuilder(function ($formattedTime){ |
|
| 48 | + return new TimeBuilder(function($formattedTime) { |
|
| 49 | 49 | $this->expirationTime = $formattedTime; |
| 50 | 50 | }, $this); |
| 51 | 51 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | return $this; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - return new TimeBuilder(function ($formattedTime){ |
|
| 65 | + return new TimeBuilder(function($formattedTime) { |
|
| 66 | 66 | $this->flushAfter = $formattedTime; |
| 67 | 67 | }, $this); |
| 68 | 68 | } |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | public function test_remember_saves_and_recover_values() |
| 234 | 234 | { |
| 235 | - $value = $this->cache->remember('remember_test_key', 60, function () { |
|
| 235 | + $value = $this->cache->remember('remember_test_key', 60, function() { |
|
| 236 | 236 | return 'valor_teste'; |
| 237 | 237 | }); |
| 238 | 238 | |
| 239 | 239 | $this->assertEquals('valor_teste', $value); |
| 240 | 240 | |
| 241 | - $cachedValue = $this->cache->remember('remember_test_key', 60, function (){ |
|
| 241 | + $cachedValue = $this->cache->remember('remember_test_key', 60, function() { |
|
| 242 | 242 | return 'novo_valor'; |
| 243 | 243 | }); |
| 244 | 244 | |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | public function test_remember_forever_saves_value_indefinitely() |
| 250 | 250 | { |
| 251 | 251 | |
| 252 | - $value = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 252 | + $value = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 253 | 253 | return 'valor_eterno'; |
| 254 | 254 | }); |
| 255 | 255 | $this->assertEquals('valor_eterno', $value); |
| 256 | 256 | |
| 257 | - $cachedValue = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 257 | + $cachedValue = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 258 | 258 | return 'novo_valor'; |
| 259 | 259 | }); |
| 260 | 260 | |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | $this->cache->flushCache(); |
| 260 | 260 | |
| 261 | - $value = $this->cache->remember('remember_test_key', 60, function () { |
|
| 261 | + $value = $this->cache->remember('remember_test_key', 60, function() { |
|
| 262 | 262 | return 'valor_teste'; |
| 263 | 263 | }); |
| 264 | 264 | |
| 265 | 265 | $this->assertEquals('valor_teste', $value); |
| 266 | 266 | |
| 267 | - $cachedValue = $this->cache->remember('remember_test_key', 60, function (){ |
|
| 267 | + $cachedValue = $this->cache->remember('remember_test_key', 60, function() { |
|
| 268 | 268 | return 'novo_valor'; |
| 269 | 269 | }); |
| 270 | 270 | |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | $this->cache->flushCache(); |
| 278 | 278 | |
| 279 | - $value = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 279 | + $value = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 280 | 280 | return 'valor_eterno'; |
| 281 | 281 | }); |
| 282 | 282 | $this->assertEquals('valor_eterno', $value); |
| 283 | 283 | |
| 284 | - $cachedValue = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 284 | + $cachedValue = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 285 | 285 | return 'novo_valor'; |
| 286 | 286 | }); |
| 287 | 287 | |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | $this->cache->flushCache(); |
| 260 | 260 | |
| 261 | - $value = $this->cache->remember('remember_test_key', 60, function () { |
|
| 261 | + $value = $this->cache->remember('remember_test_key', 60, function() { |
|
| 262 | 262 | return 'valor_teste'; |
| 263 | 263 | }); |
| 264 | 264 | |
| 265 | 265 | $this->assertEquals('valor_teste', $value); |
| 266 | 266 | |
| 267 | - $cachedValue = $this->cache->remember('remember_test_key', 60, function (){ |
|
| 267 | + $cachedValue = $this->cache->remember('remember_test_key', 60, function() { |
|
| 268 | 268 | return 'novo_valor'; |
| 269 | 269 | }); |
| 270 | 270 | |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | { |
| 277 | 277 | $this->cache->flushCache(); |
| 278 | 278 | |
| 279 | - $value = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 279 | + $value = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 280 | 280 | return 'valor_eterno'; |
| 281 | 281 | }); |
| 282 | 282 | $this->assertEquals('valor_eterno', $value); |
| 283 | 283 | |
| 284 | - $cachedValue = $this->cache->rememberForever('remember_forever_key', function () { |
|
| 284 | + $cachedValue = $this->cache->rememberForever('remember_forever_key', function() { |
|
| 285 | 285 | return 'novo_valor'; |
| 286 | 286 | }); |
| 287 | 287 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = []) |
| 21 | 21 | { |
| 22 | - return new self(self::getBefore() . ": " .$message, $code, $previous, $details); |
|
| 22 | + return new self(self::getBefore() . ": " . $message, $code, $previous, $details); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $lastFlushTime = (int) $this->fileManager->readFile($this->lastFlushTimeFile); |
|
| 55 | + $lastFlushTime = (int)$this->fileManager->readFile($this->lastFlushTimeFile); |
|
| 56 | 56 | |
| 57 | 57 | if ((time() - $lastFlushTime) >= $flushAfterSeconds) { |
| 58 | 58 | $this->flushCache(); |
@@ -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. |