@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | protected function getLimitClause() : string |
| 43 | 43 | { |
| 44 | - if (! $this->query->limit) { |
|
| 44 | + if (!$this->query->limit) { |
|
| 45 | 45 | return ''; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | protected function getOffsetClause() : string |
| 57 | 57 | { |
| 58 | - if (! $this->query->offset) { |
|
| 58 | + if (!$this->query->offset) { |
|
| 59 | 59 | return ''; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | return ''; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - return '_' . implode('_', $columns); |
|
| 71 | + return '_'.implode('_', $columns); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | protected function getWhereClauses() : string |
| 75 | 75 | { |
| 76 | - return collect($this->query->wheres)->reduce(function ($carry, $where) { |
|
| 76 | + return collect($this->query->wheres)->reduce(function($carry, $where) { |
|
| 77 | 77 | $value = array_get($where, 'value'); |
| 78 | 78 | |
| 79 | 79 | if (in_array($where['type'], ['In', 'Null', 'NotNull'])) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if (is_array(array_get($where, 'values'))) { |
| 84 | - $value .= '_' . implode('_', $where['values']); |
|
| 84 | + $value .= '_'.implode('_', $where['values']); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return "{$carry}-{$where['column']}_{$value}"; |
@@ -96,16 +96,16 @@ discard block |
||
| 96 | 96 | return ''; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - return '-' . implode('-', $eagerLoads->keys()->toArray()); |
|
| 99 | + return '-'.implode('-', $eagerLoads->keys()->toArray()); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | protected function getCacheTags() : array |
| 103 | 103 | { |
| 104 | 104 | return collect($this->eagerLoad)->keys() |
| 105 | - ->map(function ($relationName) { |
|
| 105 | + ->map(function($relationName) { |
|
| 106 | 106 | $relation = collect(explode('.', $relationName)) |
| 107 | - ->reduce(function ($carry, $name) { |
|
| 108 | - if (! $carry) { |
|
| 107 | + ->reduce(function($carry, $name) { |
|
| 108 | + if (!$carry) { |
|
| 109 | 109 | $carry = $this->model; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | public function avg($column) |
| 127 | 127 | { |
| 128 | 128 | $tags = [str_slug(get_class($this->model))]; |
| 129 | - $key = str_slug(get_class($this->model)) ."-avg_{$column}"; |
|
| 129 | + $key = str_slug(get_class($this->model))."-avg_{$column}"; |
|
| 130 | 130 | |
| 131 | 131 | return $this->cache($tags) |
| 132 | - ->rememberForever($key, function () use ($column) { |
|
| 132 | + ->rememberForever($key, function() use ($column) { |
|
| 133 | 133 | return parent::avg($column); |
| 134 | 134 | }); |
| 135 | 135 | } |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | public function count($columns = ['*']) |
| 138 | 138 | { |
| 139 | 139 | $tags = [str_slug(get_class($this->model))]; |
| 140 | - $key = str_slug(get_class($this->model)) ."-count"; |
|
| 140 | + $key = str_slug(get_class($this->model))."-count"; |
|
| 141 | 141 | |
| 142 | 142 | return $this->cache($tags) |
| 143 | - ->rememberForever($key, function () use ($columns) { |
|
| 143 | + ->rememberForever($key, function() use ($columns) { |
|
| 144 | 144 | return parent::count($columns); |
| 145 | 145 | }); |
| 146 | 146 | } |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | public function cursor() |
| 149 | 149 | { |
| 150 | 150 | $tags = [str_slug(get_class($this->model))]; |
| 151 | - $key = str_slug(get_class($this->model)) ."-cursor"; |
|
| 151 | + $key = str_slug(get_class($this->model))."-cursor"; |
|
| 152 | 152 | |
| 153 | 153 | return $this->cache($tags) |
| 154 | - ->rememberForever($key, function () { |
|
| 154 | + ->rememberForever($key, function() { |
|
| 155 | 155 | return collect(parent::cursor()); |
| 156 | 156 | }); |
| 157 | 157 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $key = $this->getCacheKey($columns, $id); |
| 166 | 166 | |
| 167 | 167 | return $this->cache($tags) |
| 168 | - ->rememberForever($key, function () use ($id, $columns) { |
|
| 168 | + ->rememberForever($key, function() use ($id, $columns) { |
|
| 169 | 169 | return parent::find($id, $columns); |
| 170 | 170 | }); |
| 171 | 171 | } |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | public function first($columns = ['*']) |
| 174 | 174 | { |
| 175 | 175 | $tags = $this->getCacheTags(); |
| 176 | - $key = $this->getCacheKey($columns) . '-first'; |
|
| 176 | + $key = $this->getCacheKey($columns).'-first'; |
|
| 177 | 177 | |
| 178 | 178 | return $this->cache($tags) |
| 179 | - ->rememberForever($key, function () use ($columns) { |
|
| 179 | + ->rememberForever($key, function() use ($columns) { |
|
| 180 | 180 | return parent::first($columns); |
| 181 | 181 | }); |
| 182 | 182 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $key = $this->getCacheKey($columns); |
| 188 | 188 | |
| 189 | 189 | return $this->cache($tags) |
| 190 | - ->rememberForever($key, function () use ($columns) { |
|
| 190 | + ->rememberForever($key, function() use ($columns) { |
|
| 191 | 191 | return parent::get($columns); |
| 192 | 192 | }); |
| 193 | 193 | } |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | public function max($column) |
| 196 | 196 | { |
| 197 | 197 | $tags = [str_slug(get_class($this->model))]; |
| 198 | - $key = str_slug(get_class($this->model)) ."-max_{$column}"; |
|
| 198 | + $key = str_slug(get_class($this->model))."-max_{$column}"; |
|
| 199 | 199 | |
| 200 | 200 | return $this->cache($tags) |
| 201 | - ->rememberForever($key, function () use ($column) { |
|
| 201 | + ->rememberForever($key, function() use ($column) { |
|
| 202 | 202 | return parent::max($column); |
| 203 | 203 | }); |
| 204 | 204 | } |
@@ -206,10 +206,10 @@ discard block |
||
| 206 | 206 | public function min($column) |
| 207 | 207 | { |
| 208 | 208 | $tags = [str_slug(get_class($this->model))]; |
| 209 | - $key = str_slug(get_class($this->model)) ."-min_{$column}"; |
|
| 209 | + $key = str_slug(get_class($this->model))."-min_{$column}"; |
|
| 210 | 210 | |
| 211 | 211 | return $this->cache($tags) |
| 212 | - ->rememberForever($key, function () use ($column) { |
|
| 212 | + ->rememberForever($key, function() use ($column) { |
|
| 213 | 213 | return parent::min($column); |
| 214 | 214 | }); |
| 215 | 215 | } |
@@ -217,14 +217,14 @@ discard block |
||
| 217 | 217 | public function pluck($column, $key = null) |
| 218 | 218 | { |
| 219 | 219 | $tags = $this->getCacheTags(); |
| 220 | - $cacheKey = $this->getCacheKey([$column]) . "-pluck_{$column}"; |
|
| 220 | + $cacheKey = $this->getCacheKey([$column])."-pluck_{$column}"; |
|
| 221 | 221 | |
| 222 | 222 | if ($key) { |
| 223 | 223 | $cacheKey .= "_{$key}"; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | return $this->cache($tags) |
| 227 | - ->rememberForever($cacheKey, function () use ($column, $key) { |
|
| 227 | + ->rememberForever($cacheKey, function() use ($column, $key) { |
|
| 228 | 228 | return parent::pluck($column, $key); |
| 229 | 229 | }); |
| 230 | 230 | } |
@@ -232,10 +232,10 @@ discard block |
||
| 232 | 232 | public function sum($column) |
| 233 | 233 | { |
| 234 | 234 | $tags = [str_slug(get_class($this->model))]; |
| 235 | - $key = str_slug(get_class($this->model)) ."-sum_{$column}"; |
|
| 235 | + $key = str_slug(get_class($this->model))."-sum_{$column}"; |
|
| 236 | 236 | |
| 237 | 237 | return $this->cache($tags) |
| 238 | - ->rememberForever($key, function () use ($column) { |
|
| 238 | + ->rememberForever($key, function() use ($column) { |
|
| 239 | 239 | return parent::sum($column); |
| 240 | 240 | }); |
| 241 | 241 | } |