@@ -216,14 +216,14 @@ |
||
216 | 216 | $type = strtolower($where["type"]); |
217 | 217 | $subquery = $this->getValuesFromWhere($where); |
218 | 218 | if(isset($this->query->bindings["where"][$this->currentBinding])){ |
219 | - $values = collect($this->query->bindings["where"][$this->currentBinding]); |
|
220 | - $this->currentBinding++; |
|
221 | - $subquery = collect(vsprintf(str_replace("?", "%s", $subquery), $values->toArray())); |
|
222 | - $values = $this->recursiveImplode($subquery->toArray(), "_"); |
|
219 | + $values = collect($this->query->bindings["where"][$this->currentBinding]); |
|
220 | + $this->currentBinding++; |
|
221 | + $subquery = collect(vsprintf(str_replace("?", "%s", $subquery), $values->toArray())); |
|
222 | + $values = $this->recursiveImplode($subquery->toArray(), "_"); |
|
223 | 223 | |
224 | - return "-{$where["column"]}_{$type}{$values}"; |
|
224 | + return "-{$where["column"]}_{$type}{$values}"; |
|
225 | 225 | }else{ |
226 | - return ""; |
|
226 | + return ""; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | protected function getLimitClause() : string |
55 | 55 | { |
56 | - if (! $this->query->limit) { |
|
56 | + if (!$this->query->limit) { |
|
57 | 57 | return ""; |
58 | 58 | } |
59 | 59 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | protected function getOffsetClause() : string |
75 | 75 | { |
76 | - if (! $this->query->offset) { |
|
76 | + if (!$this->query->offset) { |
|
77 | 77 | return ""; |
78 | 78 | } |
79 | 79 | |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | $orders = collect($this->query->orders); |
86 | 86 | |
87 | 87 | return $orders |
88 | - ->reduce(function ($carry, $order) { |
|
88 | + ->reduce(function($carry, $order) { |
|
89 | 89 | if (($order["type"] ?? "") === "Raw") { |
90 | - return $carry . "_orderByRaw_" . str_slug($order["sql"]); |
|
90 | + return $carry."_orderByRaw_".str_slug($order["sql"]); |
|
91 | 91 | } |
92 | 92 | |
93 | - return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"]; |
|
93 | + return $carry."_orderBy_".$order["column"]."_".$order["direction"]; |
|
94 | 94 | }) |
95 | 95 | ?: ""; |
96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | return ""; |
102 | 102 | } |
103 | 103 | |
104 | - return "_" . implode("_", $columns); |
|
104 | + return "_".implode("_", $columns); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function getTypeClause($where) : string |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $values = $this->getValuesFromWhere($where); |
123 | 123 | $values = $this->getValuesFromBindings($where, $values); |
124 | 124 | |
125 | - return "_" . $values; |
|
125 | + return "_".$values; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | protected function getValuesFromWhere(array $where) : string |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $subKey = str_replace($prefix, "", $subKey); |
135 | 135 | $subKey = str_replace($this->getModelSlug(), "", $subKey); |
136 | 136 | $classParts = explode("\\", get_class($this->model)); |
137 | - $subKey = strtolower(array_pop($classParts)) . $subKey; |
|
137 | + $subKey = strtolower(array_pop($classParts)).$subKey; |
|
138 | 138 | |
139 | 139 | return $subKey; |
140 | 140 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $this->currentBinding++; |
155 | 155 | |
156 | 156 | if ($where["type"] === "between") { |
157 | - $values .= "_" . $this->query->bindings["where"][$this->currentBinding]; |
|
157 | + $values .= "_".$this->query->bindings["where"][$this->currentBinding]; |
|
158 | 158 | $this->currentBinding++; |
159 | 159 | } |
160 | 160 | } |
@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | |
165 | 165 | protected function getWhereClauses(array $wheres = []) : string |
166 | 166 | { |
167 | - return "" . $this->getWheres($wheres) |
|
168 | - ->reduce(function ($carry, $where) { |
|
167 | + return "".$this->getWheres($wheres) |
|
168 | + ->reduce(function($carry, $where) { |
|
169 | 169 | $value = $carry; |
170 | 170 | $value .= $this->getNestedClauses($where); |
171 | 171 | $value .= $this->getColumnClauses($where); |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | |
180 | 180 | protected function getNestedClauses(array $where) : string |
181 | 181 | { |
182 | - if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
182 | + if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
183 | 183 | return ""; |
184 | 184 | } |
185 | 185 | |
186 | - return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); |
|
186 | + return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | protected function getColumnClauses(array $where) : string |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | protected function getInClauses(array $where) : string |
199 | 199 | { |
200 | - if (! in_array($where["type"], ["In"])) { |
|
200 | + if (!in_array($where["type"], ["In"])) { |
|
201 | 201 | return ""; |
202 | 202 | } |
203 | 203 | |
@@ -209,20 +209,20 @@ discard block |
||
209 | 209 | |
210 | 210 | protected function getInAndNotInClauses(array $where) : string |
211 | 211 | { |
212 | - if (! in_array($where["type"], ["In", "NotIn"])) { |
|
212 | + if (!in_array($where["type"], ["In", "NotIn"])) { |
|
213 | 213 | return ""; |
214 | 214 | } |
215 | 215 | |
216 | 216 | $type = strtolower($where["type"]); |
217 | 217 | $subquery = $this->getValuesFromWhere($where); |
218 | - if(isset($this->query->bindings["where"][$this->currentBinding])){ |
|
218 | + if (isset($this->query->bindings["where"][$this->currentBinding])) { |
|
219 | 219 | $values = collect($this->query->bindings["where"][$this->currentBinding]); |
220 | 220 | $this->currentBinding++; |
221 | 221 | $subquery = collect(vsprintf(str_replace("?", "%s", $subquery), $values->toArray())); |
222 | 222 | $values = $this->recursiveImplode($subquery->toArray(), "_"); |
223 | 223 | |
224 | 224 | return "-{$where["column"]}_{$type}{$values}"; |
225 | - }else{ |
|
225 | + } else { |
|
226 | 226 | return ""; |
227 | 227 | } |
228 | 228 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | continue; |
253 | 253 | } |
254 | 254 | |
255 | - $result .= $glue . $value; |
|
255 | + $result .= $glue.$value; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | return $result; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $clause = "_{$where["boolean"]}"; |
269 | 269 | |
270 | 270 | while (count($queryParts) > 1) { |
271 | - $clause .= "_" . array_shift($queryParts); |
|
271 | + $clause .= "_".array_shift($queryParts); |
|
272 | 272 | $clause .= $this->query->bindings["where"][$this->currentBinding]; |
273 | 273 | $this->currentBinding++; |
274 | 274 | } |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | $lastPart = array_shift($queryParts); |
277 | 277 | |
278 | 278 | if ($lastPart) { |
279 | - $clause .= "_" . $lastPart; |
|
279 | + $clause .= "_".$lastPart; |
|
280 | 280 | } |
281 | 281 | |
282 | - return "-" . str_replace(" ", "_", $clause); |
|
282 | + return "-".str_replace(" ", "_", $clause); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | protected function getOtherClauses(array $where) : string |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | return ""; |
314 | 314 | } |
315 | 315 | |
316 | - return $eagerLoads->keys()->reduce(function ($carry, $related) { |
|
317 | - if (! method_exists($this->model, $related)) { |
|
316 | + return $eagerLoads->keys()->reduce(function($carry, $related) { |
|
317 | + if (!method_exists($this->model, $related)) { |
|
318 | 318 | return "{$carry}-{$related}"; |
319 | 319 | } |
320 | 320 |
@@ -222,7 +222,7 @@ |
||
222 | 222 | $values = $this->recursiveImplode($subquery->toArray(), "_"); |
223 | 223 | |
224 | 224 | return "-{$where["column"]}_{$type}{$values}"; |
225 | - }else{ |
|
225 | + } else{ |
|
226 | 226 | return ""; |
227 | 227 | } |
228 | 228 |