Completed
Push — master ( 74076e...6f8a5e )
by Mike
04:24
created
src/Builder.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
         $key .= $idColumn ? "_{$idColumn}" : '';
27 27
 
28 28
         if ($columns !== ['*']) {
29
-            $key .= '_' . implode('_', $columns);
29
+            $key .= '_'.implode('_', $columns);
30 30
         }
31 31
 
32
-        $key .= collect($this->query->wheres)->reduce(function ($carry, $where) {
32
+        $key .= collect($this->query->wheres)->reduce(function($carry, $where) {
33 33
             $value = $where['value'] ?? implode('_', $where['values']) ?? '';
34 34
 
35 35
             return "{$carry}-{$where['column']}_{$value}";
36 36
         });
37 37
 
38 38
         if (collect($this->eagerLoad)->isNotEmpty()) {
39
-            $key .= '-' . implode('-', collect($this->eagerLoad)->keys()->toArray());
39
+            $key .= '-'.implode('-', collect($this->eagerLoad)->keys()->toArray());
40 40
         }
41 41
 
42 42
         if ($this->query->offset) {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     protected function getCacheTags() : array
54 54
     {
55 55
         return collect($this->eagerLoad)->keys()
56
-            ->map(function ($name) {
56
+            ->map(function($name) {
57 57
                 return str_slug(get_class(
58 58
                     $this->model
59 59
                         ->{$name}()
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     public function avg($column)
70 70
     {
71 71
         $tags = [str_slug(get_class($this->model))];
72
-        $key = str_slug(get_class($this->model)) ."-avg_{$column}";
72
+        $key = str_slug(get_class($this->model))."-avg_{$column}";
73 73
 
74 74
         return $this->cache($tags)
75
-            ->rememberForever($key, function () use ($column) {
75
+            ->rememberForever($key, function() use ($column) {
76 76
                 return parent::avg($column);
77 77
             });
78 78
     }
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
     public function count($columns = ['*'])
81 81
     {
82 82
         $tags = [str_slug(get_class($this->model))];
83
-        $key = str_slug(get_class($this->model)) ."-count";
83
+        $key = str_slug(get_class($this->model))."-count";
84 84
 
85 85
         return $this->cache($tags)
86
-            ->rememberForever($key, function () use ($columns) {
86
+            ->rememberForever($key, function() use ($columns) {
87 87
                 return parent::count($columns);
88 88
             });
89 89
     }
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     public function cursor()
92 92
     {
93 93
         $tags = [str_slug(get_class($this->model))];
94
-        $key = str_slug(get_class($this->model)) ."-cursor";
94
+        $key = str_slug(get_class($this->model))."-cursor";
95 95
 
96 96
         return $this->cache($tags)
97
-            ->rememberForever($key, function () {
97
+            ->rememberForever($key, function() {
98 98
                 return collect(parent::cursor());
99 99
             });
100 100
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $key = $this->getCacheKey($columns, $id);
109 109
 
110 110
         return $this->cache($tags)
111
-            ->rememberForever($key, function () use ($id, $columns) {
111
+            ->rememberForever($key, function() use ($id, $columns) {
112 112
                 return parent::find($id, $columns);
113 113
             });
114 114
     }
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
     public function first($columns = ['*'])
117 117
     {
118 118
         $tags = $this->getCacheTags();
119
-        $key = $this->getCacheKey($columns) . '-first';
119
+        $key = $this->getCacheKey($columns).'-first';
120 120
 
121 121
         return $this->cache($tags)
122
-            ->rememberForever($key, function () use ($columns) {
122
+            ->rememberForever($key, function() use ($columns) {
123 123
                 return parent::first($columns);
124 124
             });
125 125
     }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $key = $this->getCacheKey($columns);
131 131
 
132 132
         return $this->cache($tags)
133
-            ->rememberForever($key, function () use ($columns) {
133
+            ->rememberForever($key, function() use ($columns) {
134 134
                 return parent::get($columns);
135 135
             });
136 136
     }
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
     public function max($column)
139 139
     {
140 140
         $tags = [str_slug(get_class($this->model))];
141
-        $key = str_slug(get_class($this->model)) ."-max_{$column}";
141
+        $key = str_slug(get_class($this->model))."-max_{$column}";
142 142
 
143 143
         return $this->cache($tags)
144
-            ->rememberForever($key, function () use ($column) {
144
+            ->rememberForever($key, function() use ($column) {
145 145
                 return parent::max($column);
146 146
             });
147 147
     }
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
     public function min($column)
150 150
     {
151 151
         $tags = [str_slug(get_class($this->model))];
152
-        $key = str_slug(get_class($this->model)) ."-min_{$column}";
152
+        $key = str_slug(get_class($this->model))."-min_{$column}";
153 153
 
154 154
         return $this->cache($tags)
155
-            ->rememberForever($key, function () use ($column) {
155
+            ->rememberForever($key, function() use ($column) {
156 156
                 return parent::min($column);
157 157
             });
158 158
     }
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
     public function pluck($column, $key = null)
161 161
     {
162 162
         $tags = $this->getCacheTags();
163
-        $cacheKey = $this->getCacheKey([$column]) . "-pluck_{$column}";
163
+        $cacheKey = $this->getCacheKey([$column])."-pluck_{$column}";
164 164
 
165 165
         if ($key) {
166 166
             $cacheKey .= "_{$key}";
167 167
         }
168 168
 
169 169
         return $this->cache($tags)
170
-            ->rememberForever($cacheKey, function () use ($column, $key) {
170
+            ->rememberForever($cacheKey, function() use ($column, $key) {
171 171
                 return parent::pluck($column, $key);
172 172
             });
173 173
     }
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
     public function sum($column)
176 176
     {
177 177
         $tags = [str_slug(get_class($this->model))];
178
-        $key = str_slug(get_class($this->model)) ."-sum_{$column}";
178
+        $key = str_slug(get_class($this->model))."-sum_{$column}";
179 179
 
180 180
         return $this->cache($tags)
181
-            ->rememberForever($key, function () use ($column) {
181
+            ->rememberForever($key, function() use ($column) {
182 182
                 return parent::sum($column);
183 183
             });
184 184
     }
Please login to merge, or discard this patch.