@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if (!empty($values)) { |
137 | 137 | $normalized = array(); |
138 | 138 | foreach ($values as $index => $value) { |
139 | - $normalized[':' . $index] = $value; |
|
139 | + $normalized[':'.$index] = $value; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $values = $normalized; |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | $wheres = $this->buildDataSets($conditions); |
262 | 262 | |
263 | 263 | return |
264 | - 'UPDATE ' . $this->quote($table) . |
|
265 | - ' SET ' . implode(', ', $sets) . |
|
266 | - ' WHERE ' . implode(' AND ', $wheres); |
|
264 | + 'UPDATE '.$this->quote($table). |
|
265 | + ' SET '.implode(', ', $sets). |
|
266 | + ' WHERE '.implode(' AND ', $wheres); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | $values = array_keys($values); |
281 | 281 | |
282 | 282 | return |
283 | - 'INSERT INTO ' . $this->quote($table) . |
|
284 | - ' (' . implode(', ', $keys) . ') VALUES (:' . implode(', :', $values) . ')'; |
|
283 | + 'INSERT INTO '.$this->quote($table). |
|
284 | + ' ('.implode(', ', $keys).') VALUES (:'.implode(', :', $values).')'; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | { |
296 | 296 | $sets = array(); |
297 | 297 | foreach ($parts as $name => $value) { |
298 | - $sets[] = $this->quote($name) . '=:' . $name; |
|
298 | + $sets[] = $this->quote($name).'=:'.$name; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | return $sets; |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected function quote($field) |
312 | 312 | { |
313 | - return $this->quote . $field . $this->quote; |
|
313 | + return $this->quote.$field.$this->quote; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -290,7 +290,7 @@ |
||
290 | 290 | |
291 | 291 | /** |
292 | 292 | * @param string $table |
293 | - * @param array $conditions |
|
293 | + * @param CompositeExpressionInterface[] $conditions |
|
294 | 294 | * @param string $class |
295 | 295 | * |
296 | 296 | * @return array |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @param string $quote |
97 | 97 | * @param string|null $alias |
98 | 98 | */ |
99 | - public function __construct(Pdo &$conn, $table, $class, $parser, $quote, $alias = null) |
|
99 | + public function __construct(Pdo & $conn, $table, $class, $parser, $quote, $alias = null) |
|
100 | 100 | { |
101 | 101 | if (null === $alias) { |
102 | 102 | $alias = lcfirst($table); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | return new Collection( |
241 | 241 | array_map( |
242 | - function ($record) use ($related) { |
|
242 | + function($record) use ($related) { |
|
243 | 243 | return $this->bindRelation($this->class, $record, $related); |
244 | 244 | }, |
245 | 245 | $stmt->fetchAll() |
@@ -400,12 +400,12 @@ discard block |
||
400 | 400 | $offset = null |
401 | 401 | ) { |
402 | 402 | $parts = array( |
403 | - 'SELECT ' . $fields, |
|
404 | - 'FROM ' . $this->quote($table), |
|
403 | + 'SELECT '.$fields, |
|
404 | + 'FROM '.$this->quote($table), |
|
405 | 405 | ); |
406 | 406 | |
407 | 407 | if (!empty($alias)) { |
408 | - $parts[] = 'AS ' . $this->quote($alias); |
|
408 | + $parts[] = 'AS '.$this->quote($alias); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | if (!empty($joins)) { |
@@ -424,11 +424,11 @@ discard block |
||
424 | 424 | } |
425 | 425 | |
426 | 426 | if (!empty($conditions)) { |
427 | - $parts[] = 'WHERE ' . $this->normalizeConditions($conditions); |
|
427 | + $parts[] = 'WHERE '.$this->normalizeConditions($conditions); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | if (!empty($this->sorts)) { |
431 | - $parts[] = 'ORDER BY ' . $this->normalizeSorts($sorts); |
|
431 | + $parts[] = 'ORDER BY '.$this->normalizeSorts($sorts); |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | if (null !== $limit) { |
@@ -447,12 +447,12 @@ discard block |
||
447 | 447 | */ |
448 | 448 | protected function normalizeConditions(array $conditions) |
449 | 449 | { |
450 | - $joiner = ' ' . CompositeExpressionInterface::LOGICAL_AND . ' '; |
|
450 | + $joiner = ' '.CompositeExpressionInterface::LOGICAL_AND.' '; |
|
451 | 451 | |
452 | 452 | return implode( |
453 | 453 | $joiner, |
454 | 454 | array_map( |
455 | - function ($item) { |
|
455 | + function($item) { |
|
456 | 456 | return (string) $item; |
457 | 457 | }, |
458 | 458 | $conditions |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | { |
472 | 472 | $normalized = array(); |
473 | 473 | foreach ($sorts as $field => $direction) { |
474 | - $normalized[] = $this->quote($field) . ' ' . $direction; |
|
474 | + $normalized[] = $this->quote($field).' '.$direction; |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | return implode(', ', $normalized); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | $quotes = array(); |
491 | 491 | |
492 | 492 | foreach ($parts as $part) { |
493 | - $quotes[] = $this->quote . $part . $this->quote; |
|
493 | + $quotes[] = $this->quote.$part.$this->quote; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | return implode('.', $quotes); |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | public function comparison($field, $comparison, $value) |
39 | 39 | { |
40 | 40 | return |
41 | - $this->quote($field) . ' ' . |
|
42 | - $this->transformComparison($comparison, $value) . ' ' . |
|
41 | + $this->quote($field).' '. |
|
42 | + $this->transformComparison($comparison, $value).' '. |
|
43 | 43 | $this->normalizeValue($value); |
44 | 44 | } |
45 | 45 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $quotes = array(); |
138 | 138 | |
139 | 139 | foreach ($parts as $part) { |
140 | - $quotes[] = $this->quote . $part . $this->quote; |
|
140 | + $quotes[] = $this->quote.$part.$this->quote; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | return implode('.', $quotes); |