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