@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** @var SchemaDiffProviderInterface */ |
| 102 | 102 | private $schemaProvider; |
| 103 | 103 | |
| 104 | - public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider=null) |
|
| 104 | + public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider = null) |
|
| 105 | 105 | { |
| 106 | 106 | $this->configuration = $configuration; |
| 107 | 107 | $this->outputWriter = $configuration->getOutputWriter(); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if ($schemaProvider !== null) { |
| 114 | 114 | $this->schemaProvider = $schemaProvider; |
| 115 | 115 | } |
| 116 | - if($schemaProvider === null) { |
|
| 116 | + if ($schemaProvider === null) { |
|
| 117 | 117 | $schemaProvider = new SchemaDiffProvider($this->connection->getSchemaManager(), |
| 118 | 118 | $this->connection->getDatabasePlatform()); |
| 119 | 119 | $this->schemaProvider = LazySchemaDiffProvider::fromDefaultProxyFacyoryConfiguration($schemaProvider); |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | $queries = $this->execute($direction, true); |
| 221 | 221 | |
| 222 | - if ( ! empty($this->params)) { |
|
| 222 | + if (!empty($this->params)) { |
|
| 223 | 223 | throw MigrationException::migrationNotConvertibleToSql($this->class); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $this->outputWriter->write("\n-- Version " . $this->version . "\n"); |
|
| 226 | + $this->outputWriter->write("\n-- Version ".$this->version."\n"); |
|
| 227 | 227 | |
| 228 | 228 | $sqlQueries = [$this->version => $queries]; |
| 229 | 229 | $sqlWriter = new SqlFileWriter( |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | $this->state = self::STATE_PRE; |
| 276 | 276 | $fromSchema = $this->schemaProvider->createFromSchema(); |
| 277 | 277 | |
| 278 | - $this->migration->{'pre' . ucfirst($direction)}($fromSchema); |
|
| 278 | + $this->migration->{'pre'.ucfirst($direction)}($fromSchema); |
|
| 279 | 279 | |
| 280 | 280 | if ($direction === self::DIRECTION_UP) { |
| 281 | - $this->outputWriter->write("\n" . sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n"); |
|
| 281 | + $this->outputWriter->write("\n".sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version)."\n"); |
|
| 282 | 282 | } else { |
| 283 | - $this->outputWriter->write("\n" . sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n"); |
|
| 283 | + $this->outputWriter->write("\n".sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version)."\n"); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $this->state = self::STATE_EXEC; |
@@ -293,9 +293,9 @@ discard block |
||
| 293 | 293 | $this->executeRegisteredSql($dryRun, $timeAllQueries); |
| 294 | 294 | |
| 295 | 295 | $this->state = self::STATE_POST; |
| 296 | - $this->migration->{'post' . ucfirst($direction)}($toSchema); |
|
| 296 | + $this->migration->{'post'.ucfirst($direction)}($toSchema); |
|
| 297 | 297 | |
| 298 | - if (! $dryRun) { |
|
| 298 | + if (!$dryRun) { |
|
| 299 | 299 | if ($direction === self::DIRECTION_UP) { |
| 300 | 300 | $this->markMigrated(); |
| 301 | 301 | } else { |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | - $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 337 | + $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 338 | 338 | |
| 339 | 339 | $this->state = self::STATE_NONE; |
| 340 | 340 | |
@@ -397,13 +397,13 @@ discard block |
||
| 397 | 397 | |
| 398 | 398 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false) |
| 399 | 399 | { |
| 400 | - if (! $dryRun) { |
|
| 400 | + if (!$dryRun) { |
|
| 401 | 401 | if (!empty($this->sql)) { |
| 402 | 402 | foreach ($this->sql as $key => $query) { |
| 403 | 403 | $queryStart = microtime(true); |
| 404 | 404 | |
| 405 | - if ( ! isset($this->params[$key])) { |
|
| 406 | - $this->outputWriter->write(' <comment>-></comment> ' . $query); |
|
| 405 | + if (!isset($this->params[$key])) { |
|
| 406 | + $this->outputWriter->write(' <comment>-></comment> '.$query); |
|
| 407 | 407 | $this->connection->executeQuery($query); |
| 408 | 408 | } else { |
| 409 | 409 | $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query)); |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | } else { |
| 422 | 422 | foreach ($this->sql as $query) { |
| 423 | - $this->outputWriter->write(' <comment>-></comment> ' . $query); |
|
| 423 | + $this->outputWriter->write(' <comment>-></comment> '.$query); |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $string = $this->buildMigrationFile($queriesByVersion, $direction); |
| 70 | 70 | |
| 71 | 71 | if ($this->outputWriter) { |
| 72 | - $this->outputWriter->write("\n" . sprintf('Writing migration file to "<info>%s</info>"', $path)); |
|
| 72 | + $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | return file_put_contents($path, $string); |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | $string = sprintf("-- Doctrine Migration File Generated on %s\n", date('Y-m-d H:i:s')); |
| 81 | 81 | |
| 82 | 82 | foreach ($queriesByVersion as $version => $queries) { |
| 83 | - $string .= "\n-- Version " . $version . "\n"; |
|
| 83 | + $string .= "\n-- Version ".$version."\n"; |
|
| 84 | 84 | foreach ($queries as $query) { |
| 85 | - $string .= $query . ";\n"; |
|
| 85 | + $string .= $query.";\n"; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $path = $this->destPath; |
| 109 | 109 | if (is_dir($path)) { |
| 110 | - $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql'; |
|
| 110 | + $path = $path.'/doctrine_migration_'.date('YmdHis').'.sql'; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | return $path; |