@@ -34,18 +34,18 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | protected function applyScopesToInstance() |
| 36 | 36 | { |
| 37 | - if (! property_exists($this, "scopes") |
|
| 37 | + if (!property_exists($this, "scopes") |
|
| 38 | 38 | || $this->scopesAreApplied |
| 39 | 39 | ) { |
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | foreach ($this->scopes as $identifier => $scope) { |
| 44 | - if (! isset($this->scopes[$identifier])) { |
|
| 44 | + if (!isset($this->scopes[$identifier])) { |
|
| 45 | 45 | continue; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $this->callScope(function () use ($scope) { |
|
| 48 | + $this->callScope(function() use ($scope) { |
|
| 49 | 49 | if ($scope instanceof Closure) { |
| 50 | 50 | $scope($this); |
| 51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 104 | 104 | |
| 105 | 105 | $this->cache() |
| 106 | - ->rememberForever($cacheKey, function () { |
|
| 106 | + ->rememberForever($cacheKey, function() { |
|
| 107 | 107 | return (new Carbon)->now(); |
| 108 | 108 | }); |
| 109 | 109 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | public function getModelCacheCooldown(Model $instance) : array |
| 182 | 182 | { |
| 183 | - if (! $instance->cacheCooldownSeconds) { |
|
| 183 | + if (!$instance->cacheCooldownSeconds) { |
|
| 184 | 184 | return [null, null, null]; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | [$cacheCooldown, $invalidatedAt, $savedAt] = $this |
| 190 | 190 | ->getCacheCooldownDetails($instance, $cachePrefix, $modelClassName); |
| 191 | 191 | |
| 192 | - if (! $cacheCooldown || $cacheCooldown === 0) { |
|
| 192 | + if (!$cacheCooldown || $cacheCooldown === 0) { |
|
| 193 | 193 | return [null, null, null]; |
| 194 | 194 | } |
| 195 | 195 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | [$cacheCooldown, $invalidatedAt] = $this->getModelCacheCooldown($instance); |
| 220 | 220 | |
| 221 | - if (! $cacheCooldown |
|
| 221 | + if (!$cacheCooldown |
|
| 222 | 222 | || (new Carbon)->now()->diffInSeconds($invalidatedAt) < $cacheCooldown |
| 223 | 223 | ) { |
| 224 | 224 | return; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | [$cacheCooldown, $invalidatedAt] = $instance->getModelCacheCooldown($instance); |
| 245 | 245 | |
| 246 | - if (! $cacheCooldown) { |
|
| 246 | + if (!$cacheCooldown) { |
|
| 247 | 247 | $instance->flushCache(); |
| 248 | 248 | |
| 249 | 249 | if ($relationship) { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | ->get("laravel-model-caching.disabled"); |
| 276 | 276 | |
| 277 | 277 | return $this->isCachable |
| 278 | - && ! $isCacheDisabled; |
|
| 278 | + && !$isCacheDisabled; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | protected function setCacheCooldownSavedAtTimestamp(Model $instance) |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:saved-at"; |
| 286 | 286 | |
| 287 | 287 | $instance->cache() |
| 288 | - ->rememberForever($cacheKey, function () { |
|
| 288 | + ->rememberForever($cacheKey, function() { |
|
| 289 | 289 | return (new Carbon)->now(); |
| 290 | 290 | }); |
| 291 | 291 | } |