@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | protected function whereStringArray(string $where, array $whereBinder) |
172 | 172 | { |
173 | 173 | list($where, $whereBinder) = $this->prepareWhereString($where, $whereBinder); |
174 | - $this->where = 'WHERE ' . $where; |
|
174 | + $this->where = 'WHERE '.$where; |
|
175 | 175 | $this->binder = $this->mergeBinder($this->binder, $whereBinder); |
176 | 176 | } |
177 | 177 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function groupBy(string $what) |
185 | 185 | { |
186 | - $this->groupBy = 'GROUP BY `' . $what . '`'; |
|
186 | + $this->groupBy = 'GROUP BY `'.$what.'`'; |
|
187 | 187 | return $this; |
188 | 188 | } |
189 | 189 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | protected function havingStringArray(string $having, array $havingBinder) |
227 | 227 | { |
228 | 228 | list($having, $havingBinder) = $this->prepareWhereString($having, $havingBinder); |
229 | - $this->having = 'HAVING ' . $having; |
|
229 | + $this->having = 'HAVING '.$having; |
|
230 | 230 | $this->binder = $this->mergeBinder($this->binder, $havingBinder); |
231 | 231 | } |
232 | 232 | |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | { |
242 | 242 | $order = strtoupper($order); |
243 | 243 | if (strlen($this->orderBy) > 0) { |
244 | - $this->orderBy .= ',`' . $what . '` ' . $order; |
|
244 | + $this->orderBy .= ',`'.$what.'` '.$order; |
|
245 | 245 | } else { |
246 | - $this->orderBy = 'ORDER BY `' . $what . '` ' . $order; |
|
246 | + $this->orderBy = 'ORDER BY `'.$what.'` '.$order; |
|
247 | 247 | } |
248 | 248 | return $this; |
249 | 249 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function limit(int $start, int $length = null) |
259 | 259 | { |
260 | - $this->limit = 'LIMIT ' . $start . ($length !== null ? ',' . $length : ''); |
|
260 | + $this->limit = 'LIMIT '.$start.($length !== null ? ','.$length : ''); |
|
261 | 261 | return $this; |
262 | 262 | } |
263 | 263 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $fields = $reads; |
26 | 26 | } else { |
27 | 27 | $field = []; |
28 | - $prefix = strlen($table) ?"`{$table}`." :''; |
|
28 | + $prefix = strlen($table) ? "`{$table}`." : ''; |
|
29 | 29 | foreach ($reads as $want) { |
30 | 30 | $field[] = $prefix."`$want`"; |
31 | 31 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | foreach ($where as $name => $value) { |
49 | 49 | $query = $this->getQueryForArray($name, $value); |
50 | 50 | $and[] = $query->getQuery(); |
51 | - $binders = array_merge($binders, $query->getBinder()); |
|
51 | + $binders = array_merge($binders, $query->getBinder()); |
|
52 | 52 | } |
53 | 53 | return [implode(' AND ', $and), $binders]; |
54 | 54 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | protected function prepareQueryMark(string $sql, array $parameter) |
198 | 198 | { |
199 | 199 | $binders = []; |
200 | - $query = preg_replace_callback('/\?/', function ($match) use (&$binders, $parameter) { |
|
200 | + $query = preg_replace_callback('/\?/', function($match) use (&$binders, $parameter) { |
|
201 | 201 | $index = count($binders); |
202 | 202 | if (array_key_exists($index, $parameter)) { |
203 | 203 | $name = Binder::index($index); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | protected function mergeBinder(array $binderArray, array $parameter) |
227 | 227 | { |
228 | 228 | foreach ($parameter as $key => $value) { |
229 | - if (! ($value instanceof Binder)) { |
|
229 | + if (!($value instanceof Binder)) { |
|
230 | 230 | $value = new Binder($key, $value); |
231 | 231 | } |
232 | 232 | if (!in_array($value, $binderArray)) { |