@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /** @var SchemaDiffProviderInterface */ |
| 104 | 104 | private $schemaProvider; |
| 105 | 105 | |
| 106 | - public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider=null) |
|
| 106 | + public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider = null) |
|
| 107 | 107 | { |
| 108 | 108 | $this->configuration = $configuration; |
| 109 | 109 | $this->outputWriter = $configuration->getOutputWriter(); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ($schemaProvider !== null) { |
| 116 | 116 | $this->schemaProvider = $schemaProvider; |
| 117 | 117 | } |
| 118 | - if($schemaProvider === null) { |
|
| 118 | + if ($schemaProvider === null) { |
|
| 119 | 119 | $schemaProvider = new SchemaDiffProvider($this->connection->getSchemaManager(), |
| 120 | 120 | $this->connection->getDatabasePlatform()); |
| 121 | 121 | $this->schemaProvider = LazySchemaDiffProvider::fromDefaultProxyFacyoryConfiguration($schemaProvider); |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | { |
| 222 | 222 | $queries = $this->execute($direction, true); |
| 223 | 223 | |
| 224 | - if ( ! empty($this->params)) { |
|
| 224 | + if (!empty($this->params)) { |
|
| 225 | 225 | throw MigrationException::migrationNotConvertibleToSql($this->class); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $this->outputWriter->write("\n-- Version " . $this->version . "\n"); |
|
| 228 | + $this->outputWriter->write("\n-- Version ".$this->version."\n"); |
|
| 229 | 229 | |
| 230 | 230 | $sqlQueries = [$this->version => $queries]; |
| 231 | 231 | $sqlWriter = new SqlFileWriter( |
@@ -277,12 +277,12 @@ discard block |
||
| 277 | 277 | $this->state = self::STATE_PRE; |
| 278 | 278 | $fromSchema = $this->schemaProvider->createFromSchema(); |
| 279 | 279 | |
| 280 | - $this->migration->{'pre' . ucfirst($direction)}($fromSchema); |
|
| 280 | + $this->migration->{'pre'.ucfirst($direction)}($fromSchema); |
|
| 281 | 281 | |
| 282 | 282 | if ($direction === self::DIRECTION_UP) { |
| 283 | - $this->outputWriter->write("\n" . sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n"); |
|
| 283 | + $this->outputWriter->write("\n".sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version)."\n"); |
|
| 284 | 284 | } else { |
| 285 | - $this->outputWriter->write("\n" . sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n"); |
|
| 285 | + $this->outputWriter->write("\n".sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version)."\n"); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $this->state = self::STATE_EXEC; |
@@ -295,9 +295,9 @@ discard block |
||
| 295 | 295 | $this->executeRegisteredSql($dryRun, $timeAllQueries, $continueAfterErrors); |
| 296 | 296 | |
| 297 | 297 | $this->state = self::STATE_POST; |
| 298 | - $this->migration->{'post' . ucfirst($direction)}($toSchema); |
|
| 298 | + $this->migration->{'post'.ucfirst($direction)}($toSchema); |
|
| 299 | 299 | |
| 300 | - if (! $dryRun) { |
|
| 300 | + if (!$dryRun) { |
|
| 301 | 301 | if ($direction === self::DIRECTION_UP) { |
| 302 | 302 | $this->markMigrated(); |
| 303 | 303 | } else { |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | - $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 339 | + $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 340 | 340 | |
| 341 | 341 | $this->state = self::STATE_NONE; |
| 342 | 342 | |
@@ -399,20 +399,20 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false, $continueAfterErrors = false) |
| 401 | 401 | { |
| 402 | - if (! $dryRun) { |
|
| 402 | + if (!$dryRun) { |
|
| 403 | 403 | if (!empty($this->sql)) { |
| 404 | 404 | foreach ($this->sql as $key => $query) { |
| 405 | 405 | $queryStart = microtime(true); |
| 406 | 406 | |
| 407 | 407 | try { |
| 408 | 408 | if (!isset($this->params[$key])) { |
| 409 | - $this->outputWriter->write(' <comment>-></comment> ' . $query); |
|
| 409 | + $this->outputWriter->write(' <comment>-></comment> '.$query); |
|
| 410 | 410 | $this->connection->executeQuery($query); |
| 411 | 411 | } else { |
| 412 | 412 | $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query)); |
| 413 | 413 | $this->connection->executeQuery($query, $this->params[$key], $this->types[$key]); |
| 414 | 414 | } |
| 415 | - } catch (DBALException $e) { |
|
| 415 | + } catch (DBALException $e) { |
|
| 416 | 416 | if ($continueAfterErrors) { |
| 417 | 417 | $this->outputWriter->write(sprintf(' <error>- %s</error>', $e->getMessage())); |
| 418 | 418 | } else { |
@@ -412,7 +412,7 @@ |
||
| 412 | 412 | $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query)); |
| 413 | 413 | $this->connection->executeQuery($query, $this->params[$key], $this->types[$key]); |
| 414 | 414 | } |
| 415 | - } catch (DBALException $e) { |
|
| 415 | + } catch (DBALException $e) { |
|
| 416 | 416 | if ($continueAfterErrors) { |
| 417 | 417 | $this->outputWriter->write(sprintf(' <error>- %s</error>', $e->getMessage())); |
| 418 | 418 | } else { |