@@ -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 || $cacheCooldown === 0) { |
|
| 96 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
| 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,14 +171,14 @@ 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 | } |
| 178 | 178 | |
| 179 | 179 | public static function bootCachable() |
| 180 | 180 | { |
| 181 | - static::saved(function ($instance) { |
|
| 181 | + static::saved(function($instance) { |
|
| 182 | 182 | $instance->checkCooldownAndFlushAfterPersiting($instance); |
| 183 | 183 | }); |
| 184 | 184 | } |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | $key = $instance->makeCacheKey(); |
| 196 | 196 | |
| 197 | 197 | return $instance->cache($tags) |
| 198 | - ->rememberForever($key, function () use ($columns) { |
|
| 198 | + ->rememberForever($key, function() use ($columns) { |
|
| 199 | 199 | return parent::all($columns); |
| 200 | 200 | }); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | public function newEloquentBuilder($query) |
| 204 | 204 | { |
| 205 | - if (! $this->isCachable()) { |
|
| 205 | + if (!$this->isCachable()) { |
|
| 206 | 206 | $this->isCachable = true; |
| 207 | 207 | |
| 208 | 208 | return new EloquentBuilder($query); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | public function isCachable() : bool |
| 215 | 215 | { |
| 216 | 216 | return $this->isCachable |
| 217 | - && ! config('laravel-model-caching.disabled'); |
|
| 217 | + && !config('laravel-model-caching.disabled'); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | public function scopeWithCacheCooldownSeconds( |
@@ -226,13 +226,13 @@ discard block |
||
| 226 | 226 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:seconds"; |
| 227 | 227 | |
| 228 | 228 | $this->cache() |
| 229 | - ->rememberForever($cacheKey, function () use ($seconds) { |
|
| 229 | + ->rememberForever($cacheKey, function() use ($seconds) { |
|
| 230 | 230 | return $seconds; |
| 231 | 231 | }); |
| 232 | 232 | |
| 233 | 233 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:invalidated-at"; |
| 234 | 234 | $this->cache() |
| 235 | - ->rememberForever($cacheKey, function () { |
|
| 235 | + ->rememberForever($cacheKey, function() { |
|
| 236 | 236 | return now(); |
| 237 | 237 | }); |
| 238 | 238 | |