@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function getLimitClause() : string |
57 | 57 | { |
58 | - if (! $this->query->limit) { |
|
58 | + if (!$this->query->limit) { |
|
59 | 59 | return ""; |
60 | 60 | } |
61 | 61 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | protected function getOffsetClause() : string |
77 | 77 | { |
78 | - if (! $this->query->offset) { |
|
78 | + if (!$this->query->offset) { |
|
79 | 79 | return ""; |
80 | 80 | } |
81 | 81 | |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | $orders = collect($this->query->orders); |
88 | 88 | |
89 | 89 | return $orders |
90 | - ->reduce(function ($carry, $order) { |
|
90 | + ->reduce(function($carry, $order) { |
|
91 | 91 | if (($order["type"] ?? "") === "Raw") { |
92 | - return $carry . "_orderByRaw_" . (new Str)->slug($order["sql"]); |
|
92 | + return $carry."_orderByRaw_".(new Str)->slug($order["sql"]); |
|
93 | 93 | } |
94 | 94 | |
95 | - return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"]; |
|
95 | + return $carry."_orderBy_".$order["column"]."_".$order["direction"]; |
|
96 | 96 | }) |
97 | 97 | ?: ""; |
98 | 98 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return ""; |
104 | 104 | } |
105 | 105 | |
106 | - return "_" . implode("_", $columns); |
|
106 | + return "_".implode("_", $columns); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function getTypeClause($where) : string |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $values = $this->getValuesFromWhere($where); |
125 | 125 | $values = $this->getValuesFromBindings($where, $values); |
126 | 126 | |
127 | - return "_" . $values; |
|
127 | + return "_".$values; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | protected function getValuesFromWhere(array $where) : string |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $subKey = str_replace($prefix, "", $subKey); |
137 | 137 | $subKey = str_replace($this->getModelSlug(), "", $subKey); |
138 | 138 | $classParts = explode("\\", get_class($this->model)); |
139 | - $subKey = strtolower(array_pop($classParts)) . $subKey; |
|
139 | + $subKey = strtolower(array_pop($classParts)).$subKey; |
|
140 | 140 | |
141 | 141 | return $subKey; |
142 | 142 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->currentBinding++; |
156 | 156 | |
157 | 157 | if ($where["type"] === "between") { |
158 | - $values .= "_" . $this->query->bindings["where"][$this->currentBinding]; |
|
158 | + $values .= "_".$this->query->bindings["where"][$this->currentBinding]; |
|
159 | 159 | $this->currentBinding++; |
160 | 160 | } |
161 | 161 | } |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | |
166 | 166 | protected function getWhereClauses(array $wheres = []) : string |
167 | 167 | { |
168 | - return "" . $this->getWheres($wheres) |
|
169 | - ->reduce(function ($carry, $where) { |
|
168 | + return "".$this->getWheres($wheres) |
|
169 | + ->reduce(function($carry, $where) { |
|
170 | 170 | $value = $carry; |
171 | 171 | $value .= $this->getNestedClauses($where); |
172 | 172 | $value .= $this->getColumnClauses($where); |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | protected function getNestedClauses(array $where) : string |
182 | 182 | { |
183 | - if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
183 | + if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
184 | 184 | return ""; |
185 | 185 | } |
186 | 186 | |
187 | - return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); |
|
187 | + return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | protected function getColumnClauses(array $where) : string |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | protected function getInClauses(array $where) : string |
200 | 200 | { |
201 | - if (! in_array($where["type"], ["In"])) { |
|
201 | + if (!in_array($where["type"], ["In"])) { |
|
202 | 202 | return ""; |
203 | 203 | } |
204 | 204 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | protected function getInAndNotInClauses(array $where) : string |
212 | 212 | { |
213 | - if (! in_array($where["type"], ["In", "NotIn"])) { |
|
213 | + if (!in_array($where["type"], ["In", "NotIn"])) { |
|
214 | 214 | return ""; |
215 | 215 | } |
216 | 216 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | continue; |
249 | 249 | } |
250 | 250 | |
251 | - $result .= $glue . $value; |
|
251 | + $result .= $glue.$value; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | return $result; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $clause = "_{$where["boolean"]}"; |
265 | 265 | |
266 | 266 | while (count($queryParts) > 1) { |
267 | - $clause .= "_" . array_shift($queryParts); |
|
267 | + $clause .= "_".array_shift($queryParts); |
|
268 | 268 | $clause .= $this->query->bindings["where"][$this->currentBinding]; |
269 | 269 | $this->currentBinding++; |
270 | 270 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | $lastPart = array_shift($queryParts); |
273 | 273 | |
274 | 274 | if ($lastPart) { |
275 | - $clause .= "_" . $lastPart; |
|
275 | + $clause .= "_".$lastPart; |
|
276 | 276 | } |
277 | 277 | |
278 | - return "-" . str_replace(" ", "_", $clause); |
|
278 | + return "-".str_replace(" ", "_", $clause); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | protected function getOtherClauses(array $where) : string |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | return ""; |
310 | 310 | } |
311 | 311 | |
312 | - return $eagerLoads->keys()->reduce(function ($carry, $related) { |
|
313 | - if (! method_exists($this->model, $related)) { |
|
312 | + return $eagerLoads->keys()->reduce(function($carry, $related) { |
|
313 | + if (!method_exists($this->model, $related)) { |
|
314 | 314 | return "{$carry}-{$related}"; |
315 | 315 | } |
316 | 316 |