@@ -17,20 +17,20 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function applyScopesToInstance() |
19 | 19 | { |
20 | - if (! property_exists($this, "scopes") |
|
20 | + if (!property_exists($this, "scopes") |
|
21 | 21 | || $this->scopesAreApplied |
22 | 22 | ) { |
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
26 | 26 | foreach ($this->scopes as $identifier => $scope) { |
27 | - if (! isset($this->scopes[$identifier])) { |
|
27 | + if (!isset($this->scopes[$identifier])) { |
|
28 | 28 | continue; |
29 | 29 | } |
30 | 30 | |
31 | 31 | $this->scopesAreApplied = true; |
32 | 32 | |
33 | - $this->callScope(function () use ($scope) { |
|
33 | + $this->callScope(function() use ($scope) { |
|
34 | 34 | if ($scope instanceof Closure) { |
35 | 35 | $scope($this); |
36 | 36 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
83 | 83 | |
84 | 84 | $this->cache() |
85 | - ->rememberForever($cacheKey, function () { |
|
85 | + ->rememberForever($cacheKey, function() { |
|
86 | 86 | return (new Carbon)->now(); |
87 | 87 | }); |
88 | 88 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | |
154 | 154 | public function getModelCacheCooldown(Model $instance) : array |
155 | 155 | { |
156 | - if (! $instance->cacheCooldownSeconds) { |
|
156 | + if (!$instance->cacheCooldownSeconds) { |
|
157 | 157 | return [null, null, null]; |
158 | 158 | } |
159 | 159 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
163 | 163 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
164 | 164 | |
165 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
165 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
166 | 166 | return [null, null, null]; |
167 | 167 | } |
168 | 168 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | { |
192 | 192 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
193 | 193 | |
194 | - if (! $cacheCooldown |
|
194 | + if (!$cacheCooldown |
|
195 | 195 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
196 | 196 | ) { |
197 | 197 | return; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | { |
217 | 217 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
218 | 218 | |
219 | - if (! $cacheCooldown) { |
|
219 | + if (!$cacheCooldown) { |
|
220 | 220 | $instance->flushCache(); |
221 | 221 | |
222 | 222 | if ($relationship) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | public function isCachable() : bool |
245 | 245 | { |
246 | 246 | return $this->isCachable |
247 | - && ! config('laravel-model-caching.disabled'); |
|
247 | + && !config('laravel-model-caching.disabled'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | protected function setCacheCooldownSavedAtTimestamp(Model $instance) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
255 | 255 | |
256 | 256 | $instance->cache() |
257 | - ->rememberForever($cacheKey, function () { |
|
257 | + ->rememberForever($cacheKey, function() { |
|
258 | 258 | return (new Carbon)->now(); |
259 | 259 | }); |
260 | 260 | } |