@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 50 | 50 | |
| 51 | 51 | $this->cache() |
| 52 | - ->rememberForever($cacheKey, function () { |
|
| 52 | + ->rememberForever($cacheKey, function() { |
|
| 53 | 53 | return (new Carbon)->now(); |
| 54 | 54 | }); |
| 55 | 55 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | return "genealabs:laravel-model-caching:" |
| 61 | 61 | . (config('laravel-model-caching.cache-prefix') |
| 62 | - ? config('laravel-model-caching.cache-prefix', '') . ":" |
|
| 62 | + ? config('laravel-model-caching.cache-prefix', '').":" |
|
| 63 | 63 | : ""); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function getModelCacheCooldown(Model $instance) : array |
| 95 | 95 | { |
| 96 | - if (! $instance->useCacheCooldown) { |
|
| 96 | + if (!$instance->useCacheCooldown) { |
|
| 97 | 97 | return [null, null, null]; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
| 103 | 103 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
| 104 | 104 | |
| 105 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
| 105 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
| 106 | 106 | return [null, null, null]; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | { |
| 132 | 132 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
| 133 | 133 | |
| 134 | - if (! $cacheCooldown |
|
| 134 | + if (!$cacheCooldown |
|
| 135 | 135 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
| 136 | 136 | ) { |
| 137 | 137 | return; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
| 158 | 158 | |
| 159 | - if (! $cacheCooldown) { |
|
| 159 | + if (!$cacheCooldown) { |
|
| 160 | 160 | $instance->flushCache(); |
| 161 | 161 | |
| 162 | 162 | return; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | public function isCachable() : bool |
| 173 | 173 | { |
| 174 | 174 | return $this->isCachable |
| 175 | - && ! config('laravel-model-caching.disabled'); |
|
| 175 | + && !config('laravel-model-caching.disabled'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | protected function setCacheCooldownSavedAtTimestamp(Model $instance) |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 183 | 183 | |
| 184 | 184 | $instance->cache() |
| 185 | - ->rememberForever($cacheKey, function () { |
|
| 185 | + ->rememberForever($cacheKey, function() { |
|
| 186 | 186 | return (new Carbon)->now(); |
| 187 | 187 | }); |
| 188 | 188 | } |