@@ -37,7 +37,7 @@ |
||
37 | 37 | /** |
38 | 38 | * {@inheritDoc} |
39 | 39 | */ |
40 | - protected function _getCreateTableSQL($name, array $columns, array $options = array()){ |
|
40 | + protected function _getCreateTableSQL($name, array $columns, array $options = array()) { |
|
41 | 41 | // if auto increment is set the column is already defined as primary key |
42 | 42 | foreach ($columns as $column) { |
43 | 43 | if (!empty($column['autoincrement'])) { |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | $params = []; |
156 | 156 | foreach ($this->getParameters() as $placeholder => $value) { |
157 | 157 | if (is_array($value)) { |
158 | - $params[] = $placeholder . ' => (\'' . implode('\', \'', $value) . '\')'; |
|
158 | + $params[] = $placeholder.' => (\''.implode('\', \'', $value).'\')'; |
|
159 | 159 | } else { |
160 | - $params[] = $placeholder . ' => \'' . $value . '\''; |
|
160 | + $params[] = $placeholder.' => \''.$value.'\''; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | if (empty($params)) { |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | public function selectAlias($select, $alias) { |
375 | 375 | |
376 | 376 | $this->queryBuilder->addSelect( |
377 | - $this->helper->quoteColumnName($select) . ' AS ' . $this->helper->quoteColumnName($alias) |
|
377 | + $this->helper->quoteColumnName($select).' AS '.$this->helper->quoteColumnName($alias) |
|
378 | 378 | ); |
379 | 379 | |
380 | 380 | return $this; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | public function selectDistinct($select) { |
397 | 397 | |
398 | 398 | $this->queryBuilder->addSelect( |
399 | - 'DISTINCT ' . $this->helper->quoteColumnName($select) |
|
399 | + 'DISTINCT '.$this->helper->quoteColumnName($select) |
|
400 | 400 | ); |
401 | 401 | |
402 | 402 | return $this; |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | * @return IParameter |
1074 | 1074 | */ |
1075 | 1075 | public function createParameter($name) { |
1076 | - return new Parameter(':' . $name); |
|
1076 | + return new Parameter(':'.$name); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | /** |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | return $table; |
1141 | 1141 | } |
1142 | 1142 | |
1143 | - return '*PREFIX*' . $table; |
|
1143 | + return '*PREFIX*'.$table; |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | /** |
@@ -1155,6 +1155,6 @@ discard block |
||
1155 | 1155 | $tableAlias .= '.'; |
1156 | 1156 | } |
1157 | 1157 | |
1158 | - return $this->helper->quoteColumnName($tableAlias . $column); |
|
1158 | + return $this->helper->quoteColumnName($tableAlias.$column); |
|
1159 | 1159 | } |
1160 | 1160 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | use OCP\DB\QueryBuilder\ILiteral; |
26 | 26 | |
27 | -class Literal implements ILiteral{ |
|
27 | +class Literal implements ILiteral { |
|
28 | 28 | /** @var mixed */ |
29 | 29 | protected $literal; |
30 | 30 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | public function iLike($x, $y, $type = null) { |
49 | 49 | $x = $this->helper->quoteColumnName($x); |
50 | 50 | $y = $this->helper->quoteColumnName($y); |
51 | - return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->charset . '_general_ci LIKE', $y); |
|
51 | + return $this->expressionBuilder->comparison($x, ' COLLATE '.$this->charset.'_general_ci LIKE', $y); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public function castColumn($column, $type) { |
40 | 40 | if ($type === IQueryBuilder::PARAM_INT) { |
41 | 41 | $column = $this->helper->quoteColumnName($column); |
42 | - return new QueryFunction('CAST(' . $column . ' AS INT)'); |
|
42 | + return new QueryFunction('CAST('.$column.' AS INT)'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return parent::castColumn($column, $type); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | * @return null |
49 | 49 | */ |
50 | 50 | public function resynchronizeDatabaseSequences(Connection $conn) { |
51 | - $filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/'; |
|
51 | + $filterExpression = '/^'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/'; |
|
52 | 52 | $databaseName = $conn->getDatabase(); |
53 | 53 | $conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression); |
54 | 54 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | // fix default value in brackets - pg 9.4 is returning a negative default value in () |
38 | 38 | // see https://github.com/doctrine/dbal/issues/2427 |
39 | 39 | foreach ($tableDiff->changedColumns as $column) { |
40 | - $column->changedProperties = array_filter($column->changedProperties, function ($changedProperties) use ($column) { |
|
40 | + $column->changedProperties = array_filter($column->changedProperties, function($changedProperties) use ($column) { |
|
41 | 41 | if ($changedProperties !== 'default') { |
42 | 42 | return true; |
43 | 43 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | private function quoteKeys(array $data) { |
33 | 33 | $return = array(); |
34 | - foreach($data as $key => $value) { |
|
34 | + foreach ($data as $key => $value) { |
|
35 | 35 | $return[$this->quoteIdentifier($key)] = $value; |
36 | 36 | } |
37 | 37 | return $return; |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | * @param string $table table name without the prefix |
72 | 72 | */ |
73 | 73 | public function dropTable($table) { |
74 | - $table = $this->tablePrefix . trim($table); |
|
74 | + $table = $this->tablePrefix.trim($table); |
|
75 | 75 | $table = $this->quoteIdentifier($table); |
76 | 76 | $schema = $this->getSchemaManager(); |
77 | - if($schema->tablesExist(array($table))) { |
|
77 | + if ($schema->tablesExist(array($table))) { |
|
78 | 78 | $schema->dropTable($table); |
79 | 79 | } |
80 | 80 | } |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @param string $table table name without the prefix |
86 | 86 | * @return bool |
87 | 87 | */ |
88 | - public function tableExists($table){ |
|
89 | - $table = $this->tablePrefix . trim($table); |
|
88 | + public function tableExists($table) { |
|
89 | + $table = $this->tablePrefix.trim($table); |
|
90 | 90 | $table = $this->quoteIdentifier($table); |
91 | 91 | $schema = $this->getSchemaManager(); |
92 | 92 | return $schema->tablesExist(array($table)); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function lockTable($tableName) { |
68 | 68 | $this->conn->beginTransaction(); |
69 | - $this->conn->executeUpdate('LOCK TABLE `' .$tableName . '` IN EXCLUSIVE MODE'); |
|
69 | + $this->conn->executeUpdate('LOCK TABLE `'.$tableName.'` IN EXCLUSIVE MODE'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | if (empty($compare)) { |
94 | 94 | $compare = array_keys($input); |
95 | 95 | } |
96 | - $query = 'INSERT INTO `' .$table . '` (`' |
|
97 | - . implode('`,`', array_keys($input)) . '`) SELECT ' |
|
98 | - . str_repeat('?,', count($input)-1).'? ' // Is there a prettier alternative? |
|
99 | - . 'FROM `' . $table . '` WHERE '; |
|
96 | + $query = 'INSERT INTO `'.$table.'` (`' |
|
97 | + . implode('`,`', array_keys($input)).'`) SELECT ' |
|
98 | + . str_repeat('?,', count($input) - 1).'? ' // Is there a prettier alternative? |
|
99 | + . 'FROM `'.$table.'` WHERE '; |
|
100 | 100 | |
101 | 101 | $inserts = array_values($input); |
102 | - foreach($compare as $key) { |
|
103 | - $query .= '`' . $key . '`'; |
|
102 | + foreach ($compare as $key) { |
|
103 | + $query .= '`'.$key.'`'; |
|
104 | 104 | if (is_null($input[$key])) { |
105 | 105 | $query .= ' IS NULL AND '; |
106 | 106 | } else { |