Passed
Push — master ( fd6d00...eb3175 )
by Mike
05:29
created
src/Traits/Caching.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
 
271 271
     public function isCachable() : bool
272 272
     {
273
-        $isCacheDisabled = ! Container::getInstance()
273
+        $isCacheDisabled = !Container::getInstance()
274 274
             ->make("config")
275 275
             ->get("laravel-model-caching.enabled");
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.