@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 52 | 52 | |
| 53 | 53 | $this->cache() |
| 54 | - ->rememberForever($cacheKey, function () { |
|
| 54 | + ->rememberForever($cacheKey, function() { |
|
| 55 | 55 | return now(); |
| 56 | 56 | }); |
| 57 | 57 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | return "genealabs:laravel-model-caching:" |
| 63 | 63 | . (config('laravel-model-caching.cache-prefix') |
| 64 | - ? config('laravel-model-caching.cache-prefix', '') . ":" |
|
| 64 | + ? config('laravel-model-caching.cache-prefix', '').":" |
|
| 65 | 65 | : ""); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
| 94 | 94 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
| 95 | 95 | |
| 96 | - if (! $cacheCooldown) { |
|
| 96 | + if (!$cacheCooldown) { |
|
| 97 | 97 | return [null, null, null]; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
| 128 | 128 | |
| 129 | - if (! $cacheCooldown |
|
| 129 | + if (!$cacheCooldown |
|
| 130 | 130 | || now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
| 131 | 131 | ) { |
| 132 | 132 | return; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
| 153 | 153 | |
| 154 | - if (! $cacheCooldown) { |
|
| 154 | + if (!$cacheCooldown) { |
|
| 155 | 155 | $instance->flushCache(); |
| 156 | 156 | |
| 157 | 157 | return; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 172 | 172 | |
| 173 | 173 | $instance->cache() |
| 174 | - ->rememberForever($cacheKey, function () { |
|
| 174 | + ->rememberForever($cacheKey, function() { |
|
| 175 | 175 | return now(); |
| 176 | 176 | }); |
| 177 | 177 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public static function bootCachable() |
| 180 | 180 | { |
| 181 | 181 | // TODO: add for deleted,updated,etc? |
| 182 | - static::saved(function ($instance) { |
|
| 182 | + static::saved(function($instance) { |
|
| 183 | 183 | $instance->checkCooldownAndFlushAfterPersiting($instance); |
| 184 | 184 | }); |
| 185 | 185 | } |
@@ -196,14 +196,14 @@ discard block |
||
| 196 | 196 | $key = $instance->makeCacheKey(); |
| 197 | 197 | |
| 198 | 198 | return $instance->cache($tags) |
| 199 | - ->rememberForever($key, function () use ($columns) { |
|
| 199 | + ->rememberForever($key, function() use ($columns) { |
|
| 200 | 200 | return parent::all($columns); |
| 201 | 201 | }); |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | public function newEloquentBuilder($query) |
| 205 | 205 | { |
| 206 | - if (! $this->isCachable()) { |
|
| 206 | + if (!$this->isCachable()) { |
|
| 207 | 207 | $this->isCachable = true; |
| 208 | 208 | |
| 209 | 209 | return new EloquentBuilder($query); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | public function isCachable() : bool |
| 216 | 216 | { |
| 217 | 217 | return $this->isCachable |
| 218 | - && ! config('laravel-model-caching.disabled'); |
|
| 218 | + && !config('laravel-model-caching.disabled'); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | public function scopeWithCacheCooldownSeconds( |
@@ -227,13 +227,13 @@ discard block |
||
| 227 | 227 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:seconds"; |
| 228 | 228 | |
| 229 | 229 | $this->cache() |
| 230 | - ->rememberForever($cacheKey, function () use ($seconds) { |
|
| 230 | + ->rememberForever($cacheKey, function() use ($seconds) { |
|
| 231 | 231 | return $seconds; |
| 232 | 232 | }); |
| 233 | 233 | |
| 234 | 234 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:invalidated-at"; |
| 235 | 235 | $this->cache() |
| 236 | - ->rememberForever($cacheKey, function () { |
|
| 236 | + ->rememberForever($cacheKey, function() { |
|
| 237 | 237 | return now(); |
| 238 | 238 | }); |
| 239 | 239 | |