Passed
Pull Request — master (#302)
by
unknown
03:15
created
src/Traits/ModelCaching.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,22 +22,22 @@  discard block
 block discarded – undo
22 22
         $key = $instance->makeCacheKey();
23 23
 
24 24
         return $instance->cache($tags)
25
-            ->rememberForever($key, function () use ($columns) {
25
+            ->rememberForever($key, function() use ($columns) {
26 26
                 return parent::all($columns);
27 27
             });
28 28
     }
29 29
 
30 30
     public static function bootCachable()
31 31
     {
32
-        static::created(function ($instance) {
32
+        static::created(function($instance) {
33 33
             $instance->checkCooldownAndFlushAfterPersisting($instance);
34 34
         });
35 35
 
36
-        static::deleted(function ($instance) {
36
+        static::deleted(function($instance) {
37 37
             $instance->checkCooldownAndFlushAfterPersisting($instance);
38 38
         });
39 39
 
40
-        static::saved(function ($instance) {
40
+        static::saved(function($instance) {
41 41
             $instance->checkCooldownAndFlushAfterPersisting($instance);
42 42
         });
43 43
 
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
         //     $instance->checkCooldownAndFlushAfterPersisting($instance);
47 47
         // });
48 48
 
49
-        static::pivotAttached(function ($instance, $secondInstance, $relationship) {
49
+        static::pivotAttached(function($instance, $secondInstance, $relationship) {
50 50
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
51 51
         });
52 52
 
53
-        static::pivotDetached(function ($instance, $secondInstance, $relationship) {
53
+        static::pivotDetached(function($instance, $secondInstance, $relationship) {
54 54
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
55 55
         });
56 56
 
57
-        static::pivotUpdated(function ($instance, $secondInstance, $relationship) {
57
+        static::pivotUpdated(function($instance, $secondInstance, $relationship) {
58 58
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
59 59
         });
60 60
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     public function newEloquentBuilder($query)
72 72
     {
73
-        if (! $this->isCachable()) {
73
+        if (!$this->isCachable()) {
74 74
             $this->isCachable = false;
75 75
 
76 76
             return new EloquentBuilder($query);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         EloquentBuilder $query,
115 115
         int $seconds = null
116 116
     ) : EloquentBuilder {
117
-        if (! $seconds) {
117
+        if (!$seconds) {
118 118
             $seconds = $this->cacheCooldownSeconds;
119 119
         }
120 120
 
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
         $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:seconds";
124 124
 
125 125
         $this->cache()
126
-            ->rememberForever($cacheKey, function () use ($seconds) {
126
+            ->rememberForever($cacheKey, function() use ($seconds) {
127 127
                 return $seconds;
128 128
             });
129 129
 
130 130
         $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:invalidated-at";
131 131
         $this->cache()
132
-            ->rememberForever($cacheKey, function () {
132
+            ->rememberForever($cacheKey, function() {
133 133
                 return (new Carbon)->now();
134 134
             });
135 135
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@
 block discarded – undo
43 43
         $class = get_called_class();
44 44
         $instance = new $class;
45 45
 
46
-	    if (!$instance->isCachable()) {
47
-		    return parent::all($columns);
48
-	    }
46
+        if (!$instance->isCachable()) {
47
+            return parent::all($columns);
48
+        }
49 49
 
50 50
         $tags = $instance->makeCacheTags();
51 51
         $key = $instance->makeCacheKey();
Please login to merge, or discard this patch.