@@ -106,7 +106,7 @@ |
||
| 106 | 106 | |
| 107 | 107 | case 'in': |
| 108 | 108 | if (is_array($value)) { |
| 109 | - $quotedValues = array_map(function ($item) use ($adapter) { |
|
| 109 | + $quotedValues = array_map(function($item) use ($adapter) { |
|
| 110 | 110 | return $adapter->quoteValue($item); |
| 111 | 111 | }, $value); |
| 112 | 112 | $sqlValue = implode(', ', $quotedValues); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function setDriver($driver) |
| 109 | 109 | { |
| 110 | 110 | if (!($driver instanceof \PDO || $driver instanceof Connection)) { |
| 111 | - throw new QBException('Drive must be instance PDO or '. Connection::class); |
|
| 111 | + throw new QBException('Drive must be instance PDO or ' . Connection::class); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $this->driver = $driver; |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $values[] = '(' . implode(', ', $record) . ')'; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | - $sql = 'INSERT'. $options .' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES ' . implode(', ', $values); |
|
| 343 | + $sql = 'INSERT' . $options . ' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES ' . implode(', ', $values); |
|
| 344 | 344 | |
| 345 | 345 | return $this->quoteSql($sql); |
| 346 | 346 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $values = array_map([$this, 'quoteValue'], $rows); |
| 349 | 349 | $columns = array_map([$this, 'quoteColumn'], array_keys($rows)); |
| 350 | 350 | |
| 351 | - $sql = 'INSERT'. $options .' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES (' . implode(', ', $values) . ')'; |
|
| 351 | + $sql = 'INSERT' . $options . ' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES (' . implode(', ', $values) . ')'; |
|
| 352 | 352 | |
| 353 | 353 | return $this->quoteSql($sql); |
| 354 | 354 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $options = " {$options} "; |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - return 'UPDATE '. $options . $this->quoteTableName($tableName) . ' SET ' . implode(', ', $parts); |
|
| 367 | + return 'UPDATE ' . $options . $this->quoteTableName($tableName) . ' SET ' . implode(', ', $parts); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -629,12 +629,12 @@ discard block |
||
| 629 | 629 | $toSql = [$joinType]; |
| 630 | 630 | if (is_string($tableName) && $tableName = $this->getRawTableName($tableName)) { |
| 631 | 631 | if (strpos($tableName, 'SELECT') !== false) { |
| 632 | - $toSql[] = '(' . $this->quoteSql($tableName) . ')' ; |
|
| 632 | + $toSql[] = '(' . $this->quoteSql($tableName) . ')'; |
|
| 633 | 633 | } else { |
| 634 | - $toSql[] = $this->quoteTableName($tableName); |
|
| 634 | + $toSql[] = $this->quoteTableName($tableName); |
|
| 635 | 635 | } |
| 636 | 636 | } else if ($tableName instanceof QueryBuilder) { |
| 637 | - $toSql[] = '(' . $this->quoteSql($tableName->toSQL()) . ')' ; |
|
| 637 | + $toSql[] = '(' . $this->quoteSql($tableName->toSQL()) . ')'; |
|
| 638 | 638 | } else { |
| 639 | 639 | throw new QBException('Incorrect table name'); |
| 640 | 640 | } |
@@ -50,10 +50,10 @@ |
||
| 50 | 50 | if (strpos($sql, '?')) |
| 51 | 51 | { |
| 52 | 52 | if (mb_substr_count($sql, '?') !== count($this->params)) { |
| 53 | - throw new QBException('Incorrect parameters count in Expression: "'.addslashes($this->expression).'"'); |
|
| 53 | + throw new QBException('Incorrect parameters count in Expression: "' . addslashes($this->expression) . '"'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $sql = preg_replace_callback('~\?~', function ($matches) { |
|
| 56 | + $sql = preg_replace_callback('~\?~', function($matches) { |
|
| 57 | 57 | return $this->qb->getAdapter()->quoteValue( |
| 58 | 58 | $this->getNextParam() |
| 59 | 59 | ); |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | |
| 824 | 824 | public function generateDeleteSql() |
| 825 | 825 | { |
| 826 | - $options = $this->_queryOptions ; |
|
| 826 | + $options = $this->_queryOptions; |
|
| 827 | 827 | if ($options) { |
| 828 | 828 | $options = " {$options} "; |
| 829 | 829 | } |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | $tableName = $this->getAdapter()->getRawTableName($table); |
| 981 | 981 | |
| 982 | 982 | if (strpos($tableName, '.') !== false) { |
| 983 | - $tableName = substr($tableName, strpos($tableName, '.')+1); |
|
| 983 | + $tableName = substr($tableName, strpos($tableName, '.') + 1); |
|
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | return strtr('{table}_{count}', [ |