@@ -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 | } |
@@ -100,16 +100,16 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | if (($columns === ["*"] |
| 102 | 102 | || $columns === []) |
| 103 | - && ! $this->query->columns |
|
| 103 | + && !$this->query->columns |
|
| 104 | 104 | ) { |
| 105 | 105 | return ""; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | if ($this->query->columns) { |
| 109 | - return "_" . implode("_", $this->query->columns); |
|
| 109 | + return "_".implode("_", $this->query->columns); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - return "_" . implode("_", $columns); |
|
| 112 | + return "_".implode("_", $columns); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | protected function getTypeClause($where) : string |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | protected function getValuesClause(array $where = []) : string |
| 125 | 125 | { |
| 126 | - if (! $where |
|
| 126 | + if (!$where |
|
| 127 | 127 | || in_array($where["type"], ["NotNull", "Null"]) |
| 128 | 128 | ) { |
| 129 | 129 | return ""; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $values = $this->getValuesFromWhere($where); |
| 133 | 133 | $values = $this->getValuesFromBindings($where, $values); |
| 134 | 134 | |
| 135 | - return "_" . $values; |
|
| 135 | + return "_".$values; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | protected function getValuesFromWhere(array $where) : string |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $subKey = str_replace($prefix, "", $subKey); |
| 145 | 145 | $subKey = str_replace($this->getModelSlug(), "", $subKey); |
| 146 | 146 | $classParts = explode("\\", get_class($this->model)); |
| 147 | - $subKey = strtolower(array_pop($classParts)) . $subKey; |
|
| 147 | + $subKey = strtolower(array_pop($classParts)).$subKey; |
|
| 148 | 148 | |
| 149 | 149 | return $subKey; |
| 150 | 150 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $this->currentBinding++; |
| 164 | 164 | |
| 165 | 165 | if ($where["type"] === "between") { |
| 166 | - $values .= "_" . $this->query->bindings["where"][$this->currentBinding]; |
|
| 166 | + $values .= "_".$this->query->bindings["where"][$this->currentBinding]; |
|
| 167 | 167 | $this->currentBinding++; |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | protected function getWhereClauses(array $wheres = []) : string |
| 175 | 175 | { |
| 176 | - return "" . $this->getWheres($wheres) |
|
| 177 | - ->reduce(function ($carry, $where) { |
|
| 176 | + return "".$this->getWheres($wheres) |
|
| 177 | + ->reduce(function($carry, $where) { |
|
| 178 | 178 | $value = $carry; |
| 179 | 179 | $value .= $this->getNestedClauses($where); |
| 180 | 180 | $value .= $this->getColumnClauses($where); |
@@ -188,11 +188,11 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | protected function getNestedClauses(array $where) : string |
| 190 | 190 | { |
| 191 | - if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
| 191 | + if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) { |
|
| 192 | 192 | return ""; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); |
|
| 195 | + return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | protected function getColumnClauses(array $where) : string |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | protected function getInClauses(array $where) : string |
| 208 | 208 | { |
| 209 | - if (! in_array($where["type"], ["In"])) { |
|
| 209 | + if (!in_array($where["type"], ["In"])) { |
|
| 210 | 210 | return ""; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | protected function getInAndNotInClauses(array $where) : string |
| 220 | 220 | { |
| 221 | - if (! in_array($where["type"], ["In", "NotIn", "InRaw"])) { |
|
| 221 | + if (!in_array($where["type"], ["In", "NotIn", "InRaw"])) { |
|
| 222 | 222 | return ""; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | continue; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $result .= $glue . $value; |
|
| 259 | + $result .= $glue.$value; |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | return $result; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | protected function getRawClauses(array $where) : string |
| 266 | 266 | { |
| 267 | - if (! in_array($where["type"], ["raw"])) { |
|
| 267 | + if (!in_array($where["type"], ["raw"])) { |
|
| 268 | 268 | return ""; |
| 269 | 269 | } |
| 270 | 270 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $clause = "_{$where["boolean"]}"; |
| 273 | 273 | |
| 274 | 274 | while (count($queryParts) > 1) { |
| 275 | - $clause .= "_" . array_shift($queryParts); |
|
| 275 | + $clause .= "_".array_shift($queryParts); |
|
| 276 | 276 | $clause .= $this->query->bindings["where"][$this->currentBinding]; |
| 277 | 277 | $this->currentBinding++; |
| 278 | 278 | } |
@@ -280,10 +280,10 @@ discard block |
||
| 280 | 280 | $lastPart = array_shift($queryParts); |
| 281 | 281 | |
| 282 | 282 | if ($lastPart) { |
| 283 | - $clause .= "_" . $lastPart; |
|
| 283 | + $clause .= "_".$lastPart; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - return "-" . str_replace(" ", "_", $clause); |
|
| 286 | + return "-".str_replace(" ", "_", $clause); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | protected function getOtherClauses(array $where) : string |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | return ""; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - return $eagerLoads->keys()->reduce(function ($carry, $related) { |
|
| 321 | - if (! method_exists($this->model, $related)) { |
|
| 320 | + return $eagerLoads->keys()->reduce(function($carry, $related) { |
|
| 321 | + if (!method_exists($this->model, $related)) { |
|
| 322 | 322 | return "{$carry}-{$related}"; |
| 323 | 323 | } |
| 324 | 324 | |