@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | protected function whereStringArray(string $where, array $whereBinder) |
| 145 | 145 | { |
| 146 | 146 | list($where, $whereBinder) = $this->prepareWhereString($where, $whereBinder); |
| 147 | - $this->where = 'WHERE '. $where; |
|
| 147 | + $this->where = 'WHERE '.$where; |
|
| 148 | 148 | $this->binder = $this->mergeBinder($this->binder, $whereBinder); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function groupBy(string $what) |
| 158 | 158 | { |
| 159 | - $this->groupBy = 'GROUP BY '. $what; |
|
| 159 | + $this->groupBy = 'GROUP BY '.$what; |
|
| 160 | 160 | return $this; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | { |
| 201 | 201 | |
| 202 | 202 | list($having, $havingBinder) = $this->prepareWhereString($having, $havingBinder); |
| 203 | - $this->having = 'HAVING '. $having; |
|
| 203 | + $this->having = 'HAVING '.$having; |
|
| 204 | 204 | $this->binder = $this->mergeBinder($this->binder, $havingBinder); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function orderBy(string $what, string $order = 'ASC') |
| 215 | 215 | { |
| 216 | - $this->orderBy = 'ORDER BY '. $what.' '. $order; |
|
| 216 | + $this->orderBy = 'ORDER BY '.$what.' '.$order; |
|
| 217 | 217 | return $this; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function limit(int $start, int $length = null) |
| 228 | 228 | { |
| 229 | - $this->limit = 'LIMIT '. $start . ($length !== null ? ',' .$length :''); |
|
| 229 | + $this->limit = 'LIMIT '.$start.($length !== null ? ','.$length : ''); |
|
| 230 | 230 | return $this; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -253,9 +253,9 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | protected function prepareQuery():Query |
| 255 | 255 | { |
| 256 | - $where = [$this->where,$this->groupBy,$this->having,$this->orderBy,$this->limit]; |
|
| 256 | + $where = [$this->where, $this->groupBy, $this->having, $this->orderBy, $this->limit]; |
|
| 257 | 257 | $condition = implode(' ', array_filter(array_map('trim', $where), 'strlen')); |
| 258 | - $select = [$this->distinct,$this->select]; |
|
| 258 | + $select = [$this->distinct, $this->select]; |
|
| 259 | 259 | $selection = implode(' ', array_filter(array_map('trim', $select), 'strlen')); |
| 260 | 260 | $string = sprintf("SELECT %s FROM %s %s", $selection, $this->table, $condition); |
| 261 | 261 | return new Query($string, $this->binder); |