@@ -33,18 +33,18 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | protected function applyScopesToInstance() |
| 35 | 35 | { |
| 36 | - if (! property_exists($this, "scopes") |
|
| 36 | + if (!property_exists($this, "scopes") |
|
| 37 | 37 | || $this->scopesAreApplied |
| 38 | 38 | ) { |
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | foreach ($this->scopes as $identifier => $scope) { |
| 43 | - if (! isset($this->scopes[$identifier])) { |
|
| 43 | + if (!isset($this->scopes[$identifier])) { |
|
| 44 | 44 | continue; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $this->callScope(function () use ($scope) { |
|
| 47 | + $this->callScope(function() use ($scope) { |
|
| 48 | 48 | if ($scope instanceof Closure) { |
| 49 | 49 | $scope($this); |
| 50 | 50 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 99 | 99 | |
| 100 | 100 | $this->cache() |
| 101 | - ->rememberForever($cacheKey, function () { |
|
| 101 | + ->rememberForever($cacheKey, function() { |
|
| 102 | 102 | return (new Carbon)->now(); |
| 103 | 103 | }); |
| 104 | 104 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | public function getModelCacheCooldown(Model $instance) : array |
| 171 | 171 | { |
| 172 | - if (! $instance->cacheCooldownSeconds) { |
|
| 172 | + if (!$instance->cacheCooldownSeconds) { |
|
| 173 | 173 | return [null, null, null]; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
| 179 | 179 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
| 180 | 180 | |
| 181 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
| 181 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
| 182 | 182 | return [null, null, null]; |
| 183 | 183 | } |
| 184 | 184 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
| 209 | 209 | |
| 210 | - if (! $cacheCooldown |
|
| 210 | + if (!$cacheCooldown |
|
| 211 | 211 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
| 212 | 212 | ) { |
| 213 | 213 | return; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | { |
| 233 | 233 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
| 234 | 234 | |
| 235 | - if (! $cacheCooldown) { |
|
| 235 | + if (!$cacheCooldown) { |
|
| 236 | 236 | $instance->flushCache(); |
| 237 | 237 | |
| 238 | 238 | if ($relationship) { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | public function isCachable() : bool |
| 261 | 261 | { |
| 262 | 262 | return $this->isCachable |
| 263 | - && ! config('laravel-model-caching.disabled'); |
|
| 263 | + && !config('laravel-model-caching.disabled'); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | protected function setCacheCooldownSavedAtTimestamp(Model $instance) |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 271 | 271 | |
| 272 | 272 | $instance->cache() |
| 273 | - ->rememberForever($cacheKey, function () { |
|
| 273 | + ->rememberForever($cacheKey, function() { |
|
| 274 | 274 | return (new Carbon)->now(); |
| 275 | 275 | }); |
| 276 | 276 | } |