@@ -17,8 +17,8 @@ |
||
| 17 | 17 | : ""; |
| 18 | 18 | |
| 19 | 19 | return "genealabs:laravel-model-caching:" |
| 20 | - . $this->getConnectionName() . ":" |
|
| 21 | - . $this->getDatabaseName() . ":" |
|
| 20 | + . $this->getConnectionName().":" |
|
| 21 | + . $this->getDatabaseName().":" |
|
| 22 | 22 | . $cachePrefix; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -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 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | public function getModelCacheCooldown(Model $instance) : array |
| 121 | 121 | { |
| 122 | - if (! $instance->cacheCooldownSeconds) { |
|
| 122 | + if (!$instance->cacheCooldownSeconds) { |
|
| 123 | 123 | return [null, null, null]; |
| 124 | 124 | } |
| 125 | 125 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
| 129 | 129 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
| 130 | 130 | |
| 131 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
| 131 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
| 132 | 132 | return [null, null, null]; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
| 159 | 159 | |
| 160 | - if (! $cacheCooldown |
|
| 160 | + if (!$cacheCooldown |
|
| 161 | 161 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
| 162 | 162 | ) { |
| 163 | 163 | return; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
| 184 | 184 | |
| 185 | - if (! $cacheCooldown) { |
|
| 185 | + if (!$cacheCooldown) { |
|
| 186 | 186 | $instance->flushCache(); |
| 187 | 187 | |
| 188 | 188 | if ($relationship) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | public function isCachable() : bool |
| 207 | 207 | { |
| 208 | 208 | return $this->isCachable |
| 209 | - && ! config('laravel-model-caching.disabled'); |
|
| 209 | + && !config('laravel-model-caching.disabled'); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | protected function setCacheCooldownSavedAtTimestamp(Model $instance) |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 217 | 217 | |
| 218 | 218 | $instance->cache() |
| 219 | - ->rememberForever($cacheKey, function () { |
|
| 219 | + ->rememberForever($cacheKey, function() { |
|
| 220 | 220 | return (new Carbon)->now(); |
| 221 | 221 | }); |
| 222 | 222 | } |