@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | $option = $this->option('model'); |
14 | 14 | |
15 | - if (! $option) { |
|
15 | + if (!$option) { |
|
16 | 16 | return $this->flushEntireCache(); |
17 | 17 | } |
18 | 18 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $usesCachableTrait = Caching::getAllTraitsUsedByClass($option) |
37 | 37 | ->contains("GeneaLabs\LaravelModelCaching\Traits\Cachable"); |
38 | 38 | |
39 | - if (! $usesCachableTrait) { |
|
39 | + if (!$usesCachableTrait) { |
|
40 | 40 | $this->error("'{$option}' is not an instance of CachedModel."); |
41 | 41 | $this->line("Only CachedModel instances can be flushed."); |
42 | 42 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
51 | 51 | |
52 | 52 | $this->cache() |
53 | - ->rememberForever($cacheKey, function () { |
|
53 | + ->rememberForever($cacheKey, function() { |
|
54 | 54 | return (new Carbon)->now(); |
55 | 55 | }); |
56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | return "genealabs:laravel-model-caching:" |
62 | 62 | . (config('laravel-model-caching.cache-prefix') |
63 | - ? config('laravel-model-caching.cache-prefix', '') . ":" |
|
63 | + ? config('laravel-model-caching.cache-prefix', '').":" |
|
64 | 64 | : ""); |
65 | 65 | } |
66 | 66 | |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | $cachePrefix = $this->getCachePrefix(); |
98 | 98 | $modelClassName = get_class($instance); |
99 | 99 | |
100 | - if( $this->cooldownDisabled($modelClassName) ){ |
|
100 | + if ($this->cooldownDisabled($modelClassName)) { |
|
101 | 101 | return [null, null, null]; |
102 | 102 | } |
103 | 103 | |
104 | 104 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
105 | 105 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
106 | 106 | |
107 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
107 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
108 | 108 | return [null, null, null]; |
109 | 109 | } |
110 | 110 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
135 | 135 | |
136 | - if (! $cacheCooldown |
|
136 | + if (!$cacheCooldown |
|
137 | 137 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
138 | 138 | ) { |
139 | 139 | return; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | { |
159 | 159 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
160 | 160 | |
161 | - if (! $cacheCooldown) { |
|
161 | + if (!$cacheCooldown) { |
|
162 | 162 | $instance->flushCache(); |
163 | 163 | |
164 | 164 | return; |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | public function isCachable() : bool |
175 | 175 | { |
176 | 176 | return $this->isCachable |
177 | - && ! config('laravel-model-caching.disabled'); |
|
177 | + && !config('laravel-model-caching.disabled'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | public function cooldownDisabled(string $class) : bool |
181 | 181 | { |
182 | - return ! config('laravel-model-caching.enable-cooldown', true) |
|
182 | + return !config('laravel-model-caching.enable-cooldown', true) |
|
183 | 183 | || in_array($class, config('laravel-model-caching.cooldown-disable', [])) |
184 | 184 | || $this->getAllTraitsUsedByClass($class) |
185 | 185 | ->contains('GeneaLabs\LaravelModelCaching\Traits\DisableCooldown'); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
214 | 214 | |
215 | 215 | $instance->cache() |
216 | - ->rememberForever($cacheKey, function () { |
|
216 | + ->rememberForever($cacheKey, function() { |
|
217 | 217 | return (new Carbon)->now(); |
218 | 218 | }); |
219 | 219 | } |