@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @throws Exception |
101 | 101 | */ |
102 | 102 | public function createSchema() { |
103 | - $this->connection->getConfiguration()->setSchemaAssetsFilter(function ($asset) { |
|
103 | + $this->connection->getConfiguration()->setSchemaAssetsFilter(function($asset) { |
|
104 | 104 | /** @var string|AbstractAsset $asset */ |
105 | 105 | $filterExpression = $this->getFilterExpression(); |
106 | 106 | if ($asset instanceof AbstractAsset) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
132 | - $this->connection->getConfiguration()->setSchemaAssetsFilter(function ($asset) { |
|
132 | + $this->connection->getConfiguration()->setSchemaAssetsFilter(function($asset) { |
|
133 | 133 | /** @var string|AbstractAsset $asset */ |
134 | 134 | $filterExpression = $this->getFilterExpression(); |
135 | 135 | if ($asset instanceof AbstractAsset) { |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | * @return string |
189 | 189 | */ |
190 | 190 | protected function convertStatementToScript($statement) { |
191 | - $script = $statement . ';'; |
|
191 | + $script = $statement.';'; |
|
192 | 192 | $script .= PHP_EOL; |
193 | 193 | $script .= PHP_EOL; |
194 | 194 | return $script; |
195 | 195 | } |
196 | 196 | |
197 | 197 | protected function getFilterExpression() { |
198 | - return '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/'; |
|
198 | + return '/^'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/'; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | protected function emit($sql, $step, $max) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return new Index( |
79 | 79 | //TODO migrate existing uppercase indexes, then $this->connection->quoteIdentifier($index->getName()), |
80 | 80 | $index->getName(), |
81 | - array_map(function ($columnName) { |
|
81 | + array_map(function($columnName) { |
|
82 | 82 | return $this->connection->quoteIdentifier($columnName); |
83 | 83 | }, $index->getColumns()), |
84 | 84 | $index->isUnique(), |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function quoteForeignKeyConstraint($fkc) { |
99 | 99 | return new ForeignKeyConstraint( |
100 | - array_map(function ($columnName) { |
|
100 | + array_map(function($columnName) { |
|
101 | 101 | return $this->connection->quoteIdentifier($columnName); |
102 | 102 | }, $fkc->getLocalColumns()), |
103 | 103 | $this->connection->quoteIdentifier($fkc->getForeignTableName()), |
104 | - array_map(function ($columnName) { |
|
104 | + array_map(function($columnName) { |
|
105 | 105 | return $this->connection->quoteIdentifier($columnName); |
106 | 106 | }, $fkc->getForeignColumns()), |
107 | 107 | $fkc->getName(), |
@@ -119,24 +119,24 @@ discard block |
||
119 | 119 | $schemaDiff = parent::getDiff($targetSchema, $connection); |
120 | 120 | |
121 | 121 | // oracle forces us to quote the identifiers |
122 | - $schemaDiff->newTables = array_map(function (Table $table) { |
|
122 | + $schemaDiff->newTables = array_map(function(Table $table) { |
|
123 | 123 | return new Table( |
124 | 124 | $this->connection->quoteIdentifier($table->getName()), |
125 | - array_map(function (Column $column) { |
|
125 | + array_map(function(Column $column) { |
|
126 | 126 | return $this->quoteColumn($column); |
127 | 127 | }, $table->getColumns()), |
128 | - array_map(function (Index $index) { |
|
128 | + array_map(function(Index $index) { |
|
129 | 129 | return $this->quoteIndex($index); |
130 | 130 | }, $table->getIndexes()), |
131 | 131 | [], |
132 | - array_map(function (ForeignKeyConstraint $fck) { |
|
132 | + array_map(function(ForeignKeyConstraint $fck) { |
|
133 | 133 | return $this->quoteForeignKeyConstraint($fck); |
134 | 134 | }, $table->getForeignKeys()), |
135 | 135 | $table->getOptions() |
136 | 136 | ); |
137 | 137 | }, $schemaDiff->newTables); |
138 | 138 | |
139 | - $schemaDiff->removedTables = array_map(function (Table $table) { |
|
139 | + $schemaDiff->removedTables = array_map(function(Table $table) { |
|
140 | 140 | return new Table( |
141 | 141 | $this->connection->quoteIdentifier($table->getName()), |
142 | 142 | $table->getColumns(), |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | foreach ($schemaDiff->changedTables as $tableDiff) { |
151 | 151 | $tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name); |
152 | 152 | |
153 | - $tableDiff->addedColumns = array_map(function (Column $column) { |
|
153 | + $tableDiff->addedColumns = array_map(function(Column $column) { |
|
154 | 154 | return $this->quoteColumn($column); |
155 | 155 | }, $tableDiff->addedColumns); |
156 | 156 | |
@@ -160,43 +160,43 @@ discard block |
||
160 | 160 | $column->changedProperties = array_diff($column->changedProperties, ['autoincrement', 'unsigned']); |
161 | 161 | } |
162 | 162 | // remove columns that no longer have changed (because autoincrement and unsigned are not supported) |
163 | - $tableDiff->changedColumns = array_filter($tableDiff->changedColumns, function (ColumnDiff $column) { |
|
163 | + $tableDiff->changedColumns = array_filter($tableDiff->changedColumns, function(ColumnDiff $column) { |
|
164 | 164 | return count($column->changedProperties) > 0; |
165 | 165 | }); |
166 | 166 | |
167 | - $tableDiff->removedColumns = array_map(function (Column $column) { |
|
167 | + $tableDiff->removedColumns = array_map(function(Column $column) { |
|
168 | 168 | return $this->quoteColumn($column); |
169 | 169 | }, $tableDiff->removedColumns); |
170 | 170 | |
171 | - $tableDiff->renamedColumns = array_map(function (Column $column) { |
|
171 | + $tableDiff->renamedColumns = array_map(function(Column $column) { |
|
172 | 172 | return $this->quoteColumn($column); |
173 | 173 | }, $tableDiff->renamedColumns); |
174 | 174 | |
175 | - $tableDiff->addedIndexes = array_map(function (Index $index) { |
|
175 | + $tableDiff->addedIndexes = array_map(function(Index $index) { |
|
176 | 176 | return $this->quoteIndex($index); |
177 | 177 | }, $tableDiff->addedIndexes); |
178 | 178 | |
179 | - $tableDiff->changedIndexes = array_map(function (Index $index) { |
|
179 | + $tableDiff->changedIndexes = array_map(function(Index $index) { |
|
180 | 180 | return $this->quoteIndex($index); |
181 | 181 | }, $tableDiff->changedIndexes); |
182 | 182 | |
183 | - $tableDiff->removedIndexes = array_map(function (Index $index) { |
|
183 | + $tableDiff->removedIndexes = array_map(function(Index $index) { |
|
184 | 184 | return $this->quoteIndex($index); |
185 | 185 | }, $tableDiff->removedIndexes); |
186 | 186 | |
187 | - $tableDiff->renamedIndexes = array_map(function (Index $index) { |
|
187 | + $tableDiff->renamedIndexes = array_map(function(Index $index) { |
|
188 | 188 | return $this->quoteIndex($index); |
189 | 189 | }, $tableDiff->renamedIndexes); |
190 | 190 | |
191 | - $tableDiff->addedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
191 | + $tableDiff->addedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
192 | 192 | return $this->quoteForeignKeyConstraint($fkc); |
193 | 193 | }, $tableDiff->addedForeignKeys); |
194 | 194 | |
195 | - $tableDiff->changedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
195 | + $tableDiff->changedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
196 | 196 | return $this->quoteForeignKeyConstraint($fkc); |
197 | 197 | }, $tableDiff->changedForeignKeys); |
198 | 198 | |
199 | - $tableDiff->removedForeignKeys = array_map(function (ForeignKeyConstraint $fkc) { |
|
199 | + $tableDiff->removedForeignKeys = array_map(function(ForeignKeyConstraint $fkc) { |
|
200 | 200 | return $this->quoteForeignKeyConstraint($fkc); |
201 | 201 | }, $tableDiff->removedForeignKeys); |
202 | 202 | } |
@@ -210,15 +210,15 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function convertStatementToScript($statement) { |
212 | 212 | if (substr($statement, -1) === ';') { |
213 | - return $statement . PHP_EOL . '/' . PHP_EOL; |
|
213 | + return $statement.PHP_EOL.'/'.PHP_EOL; |
|
214 | 214 | } |
215 | - $script = $statement . ';'; |
|
215 | + $script = $statement.';'; |
|
216 | 216 | $script .= PHP_EOL; |
217 | 217 | $script .= PHP_EOL; |
218 | 218 | return $script; |
219 | 219 | } |
220 | 220 | |
221 | 221 | protected function getFilterExpression() { |
222 | - return '/^"' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/'; |
|
222 | + return '/^"'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/'; |
|
223 | 223 | } |
224 | 224 | } |