@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | protected function getLimitClause() : string |
52 | 52 | { |
53 | - if (! $this->query->limit) { |
|
53 | + if (!$this->query->limit) { |
|
54 | 54 | return ""; |
55 | 55 | } |
56 | 56 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | protected function getOffsetClause() : string |
66 | 66 | { |
67 | - if (! $this->query->offset) { |
|
67 | + if (!$this->query->offset) { |
|
68 | 68 | return ""; |
69 | 69 | } |
70 | 70 | |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | $orders = collect($this->query->orders); |
77 | 77 | |
78 | 78 | return $orders |
79 | - ->reduce(function ($carry, $order) { |
|
79 | + ->reduce(function($carry, $order) { |
|
80 | 80 | if (($order["type"] ?? "") === "Raw") { |
81 | - return $carry . "_orderByRaw_" . str_slug($order["sql"]); |
|
81 | + return $carry."_orderByRaw_".str_slug($order["sql"]); |
|
82 | 82 | } |
83 | 83 | |
84 | - return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"]; |
|
84 | + return $carry."_orderBy_".$order["column"]."_".$order["direction"]; |
|
85 | 85 | }) |
86 | 86 | ?: ""; |
87 | 87 | } |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | return ""; |
93 | 93 | } |
94 | 94 | |
95 | - return "_" . implode("_", $columns); |
|
95 | + return "_".implode("_", $columns); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | protected function getTypeClause($where) : string |
99 | 99 | { |
100 | - $type =in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"]) |
|
100 | + $type = in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"]) |
|
101 | 101 | ? strtolower($where["type"]) |
102 | 102 | : strtolower($where["operator"]); |
103 | 103 | |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | |
116 | 116 | |
117 | 117 | |
118 | - return "_" . $values; |
|
118 | + return "_".$values; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | protected function getValuesFromWhere(array $where) : string |
122 | 122 | { |
123 | 123 | if (is_array(array_get($where, "values"))) { |
124 | - return implode("_", array_map(function ($key, $value) { |
|
124 | + return implode("_", array_map(function($key, $value) { |
|
125 | 125 | if (is_array($value)) { |
126 | 126 | return implode("_", $value + [$key]); |
127 | 127 | } |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | |
136 | 136 | protected function getValuesFromBindings(array $where, string $values) : string |
137 | 137 | { |
138 | - if (! $values && ($this->query->bindings["where"] ?? false)) { |
|
138 | + if (!$values && ($this->query->bindings["where"] ?? false)) { |
|
139 | 139 | $values = $this->query->bindings["where"][$this->currentBinding]; |
140 | 140 | $this->currentBinding++; |
141 | 141 | |
142 | 142 | if ($where["type"] === "between") { |
143 | - $values .= "_" . $this->query->bindings["where"][$this->currentBinding]; |
|
143 | + $values .= "_".$this->query->bindings["where"][$this->currentBinding]; |
|
144 | 144 | $this->currentBinding++; |
145 | 145 | } |
146 | 146 | } |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | |
151 | 151 | protected function getWhereClauses(array $wheres = []) : string |
152 | 152 | { |
153 | - return "" . $this->getWheres($wheres) |
|
154 | - ->reduce(function ($carry, $where) { |
|
153 | + return "".$this->getWheres($wheres) |
|
154 | + ->reduce(function($carry, $where) { |
|
155 | 155 | $value = $carry; |
156 | 156 | $value .= $this->getNestedClauses($where); |
157 | 157 | $value .= $this->getColumnClauses($where); |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | |
165 | 165 | protected function getNestedClauses(array $where) : string |
166 | 166 | { |
167 | - if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
167 | + if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
168 | 168 | return ""; |
169 | 169 | } |
170 | 170 | |
171 | 171 | $this->currentBinding++; |
172 | 172 | |
173 | - return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); |
|
173 | + return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | protected function getColumnClauses(array $where) : string |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $clause = "_{$where["boolean"]}"; |
195 | 195 | |
196 | 196 | while (count($queryParts) > 1) { |
197 | - $clause .= "_" . array_shift($queryParts); |
|
197 | + $clause .= "_".array_shift($queryParts); |
|
198 | 198 | $clause .= $this->query->bindings["where"][$this->currentBinding]; |
199 | 199 | $this->currentBinding++; |
200 | 200 | } |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | $lastPart = array_shift($queryParts); |
203 | 203 | |
204 | 204 | if ($lastPart) { |
205 | - $clause .= "_" . $lastPart; |
|
205 | + $clause .= "_".$lastPart; |
|
206 | 206 | } |
207 | 207 | |
208 | - return "-" . str_replace(" ", "_", $clause); |
|
208 | + return "-".str_replace(" ", "_", $clause); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | protected function getOtherClauses(array $where, string $carry = null) : string |
@@ -239,6 +239,6 @@ discard block |
||
239 | 239 | return ""; |
240 | 240 | } |
241 | 241 | |
242 | - return "-" . implode("-", $eagerLoads->keys()->toArray()); |
|
242 | + return "-".implode("-", $eagerLoads->keys()->toArray()); |
|
243 | 243 | } |
244 | 244 | } |