@@ -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'])) { |
@@ -73,9 +73,9 @@ |
||
73 | 73 | return $string; |
74 | 74 | } |
75 | 75 | |
76 | - return $alias . '.`' . $columnName . '`'; |
|
76 | + return $alias.'.`'.$columnName.'`'; |
|
77 | 77 | } |
78 | 78 | |
79 | - return '`' . $string . '`'; |
|
79 | + return '`'.$string.'`'; |
|
80 | 80 | } |
81 | 81 | } |
@@ -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 |
@@ -147,7 +147,7 @@ |
||
147 | 147 | public function castColumn($column, $type) { |
148 | 148 | if ($type === IQueryBuilder::PARAM_STR) { |
149 | 149 | $column = $this->helper->quoteColumnName($column); |
150 | - return new QueryFunction('to_char(' . $column . ')'); |
|
150 | + return new QueryFunction('to_char('.$column.')'); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return parent::castColumn($column, $type); |
@@ -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 { |