@@ -78,8 +78,8 @@ |
||
| 78 | 78 | * |
| 79 | 79 | * @return callable |
| 80 | 80 | */ |
| 81 | - protected function getFileSortCallback(){ |
|
| 82 | - return function ($a, $b) { |
|
| 81 | + protected function getFileSortCallback() { |
|
| 82 | + return function($a, $b) { |
|
| 83 | 83 | return (basename($a) < basename($b)) ? -1 : 1; |
| 84 | 84 | }; |
| 85 | 85 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $question = 'Are you sure you wish to continue? (y/n)'; |
| 117 | - if (! $this->canExecute($question, $input, $output)) { |
|
| 117 | + if (!$this->canExecute($question, $input, $output)) { |
|
| 118 | 118 | $output->writeln('<error>Migration cancelled!</error>'); |
| 119 | 119 | |
| 120 | 120 | return 1; |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | $dryRun = (boolean) $input->getOption('dry-run'); |
| 129 | 129 | |
| 130 | 130 | // warn the user if no dry run and interaction is on |
| 131 | - if (! $dryRun) { |
|
| 131 | + if (!$dryRun) { |
|
| 132 | 132 | $question = 'WARNING! You are about to execute a database migration' |
| 133 | 133 | . ' that could result in schema changes and data lost.' |
| 134 | 134 | . ' Are you sure you wish to continue? (y/n)'; |
| 135 | - if (! $this->canExecute($question, $input, $output)) { |
|
| 135 | + if (!$this->canExecute($question, $input, $output)) { |
|
| 136 | 136 | $output->writeln('<error>Migration cancelled!</error>'); |
| 137 | 137 | |
| 138 | 138 | return 1; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | private function canExecute($question, InputInterface $input, OutputInterface $output) |
| 158 | 158 | { |
| 159 | - if ($input->isInteractive() && ! $this->askConfirmation($question, $input, $output)) { |
|
| 159 | + if ($input->isInteractive() && !$this->askConfirmation($question, $input, $output)) { |
|
| 160 | 160 | return false; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | protected function setConfiguration(Array $config) |
| 62 | 62 | { |
| 63 | - foreach($config as $configurationKey => $configurationValue) { |
|
| 63 | + foreach ($config as $configurationKey => $configurationValue) { |
|
| 64 | 64 | if (!isset($this->configurationProperties[$configurationKey])) { |
| 65 | 65 | $msg = sprintf('Migrations configuration key "%s" does not exists.', $configurationKey); |
| 66 | 66 | throw MigrationException::configurationNotValid($msg); |
@@ -787,7 +787,7 @@ |
||
| 787 | 787 | */ |
| 788 | 788 | private function ensureMigrationClassExists($class) |
| 789 | 789 | { |
| 790 | - if ( ! class_exists($class)) { |
|
| 790 | + if (!class_exists($class)) { |
|
| 791 | 791 | throw MigrationException::migrationClassNotFound($class, $this->getMigrationsNamespace()); |
| 792 | 792 | } |
| 793 | 793 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | return $this->proxyFactory->createProxy( |
| 49 | 49 | Schema::class, |
| 50 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
| 50 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
| 51 | 51 | $initializer = null; |
| 52 | 52 | $wrappedObject = $originalSchemaManipulator->createFromSchema(); |
| 53 | 53 | |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $originalSchemaManipulator = $this->originalSchemaManipulator; |
| 66 | 66 | |
| 67 | - if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) { |
|
| 67 | + if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) { |
|
| 68 | 68 | return $this->proxyFactory->createProxy( |
| 69 | 69 | Schema::class, |
| 70 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
| 70 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
| 71 | 71 | $initializer = null; |
| 72 | 72 | $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema); |
| 73 | 73 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if ( |
| 91 | 91 | $toSchema instanceof LazyLoadingInterface |
| 92 | - && ! $toSchema->isProxyInitialized() |
|
| 92 | + && !$toSchema->isProxyInitialized() |
|
| 93 | 93 | ) { |
| 94 | 94 | return []; |
| 95 | 95 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | if ($name == 'New Migrations') { |
| 68 | 68 | $value = $value > 0 ? '<question>' . $value . '</question>' : 0; |
| 69 | 69 | } |
| 70 | - if($name == 'Executed Unavailable Migrations') { |
|
| 70 | + if ($name == 'Executed Unavailable Migrations') { |
|
| 71 | 71 | $value = $value > 0 ? '<error>' . $value . '</error>' : 0; |
| 72 | 72 | } |
| 73 | 73 | $this->writeStatusInfosLineAligned($output, $name, $value); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $migratedVersions = $configuration->getMigratedVersions(); |
| 101 | 101 | |
| 102 | - foreach($migrations as $version) { |
|
| 102 | + foreach ($migrations as $version) { |
|
| 103 | 103 | $isMigrated = in_array($version->getVersion(), $migratedVersions); |
| 104 | 104 | $status = $isMigrated ? '<info>migrated</info>' : '<error>not migrated</error>'; |
| 105 | 105 | $migrationDescription = ''; |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $output->writeln(' <comment>>></comment> ' . $formattedVersion . |
| 112 | 112 | ' (<comment>' . $version->getVersion() . '</comment>)' . |
| 113 | - str_repeat(' ', 49 - strlen($formattedVersion) - strlen($version->getVersion())) . |
|
| 114 | - $status . $migrationDescription); |
|
| 113 | + str_repeat(' ', 49 - strlen($formattedVersion) - strlen($version->getVersion())) . |
|
| 114 | + $status . $migrationDescription); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** @var SchemaDiffProviderInterface */ |
| 103 | 103 | private $schemaProvider; |
| 104 | 104 | |
| 105 | - public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider=null) |
|
| 105 | + public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider = null) |
|
| 106 | 106 | { |
| 107 | 107 | $this->configuration = $configuration; |
| 108 | 108 | $this->outputWriter = $configuration->getOutputWriter(); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | if ($schemaProvider !== null) { |
| 115 | 115 | $this->schemaProvider = $schemaProvider; |
| 116 | 116 | } |
| 117 | - if($schemaProvider === null) { |
|
| 117 | + if ($schemaProvider === null) { |
|
| 118 | 118 | $schemaProvider = new SchemaDiffProvider($this->connection->getSchemaManager(), |
| 119 | 119 | $this->connection->getDatabasePlatform()); |
| 120 | 120 | $this->schemaProvider = new LazySchemaDiffProvider(new LazyLoadingValueHolderFactory(), $schemaProvider); |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | { |
| 209 | 209 | $queries = $this->execute($direction, true); |
| 210 | 210 | |
| 211 | - if ( ! empty($this->params)) { |
|
| 211 | + if (!empty($this->params)) { |
|
| 212 | 212 | throw MigrationException::migrationNotConvertibleToSql($this->class); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | $this->state = self::STATE_POST; |
| 285 | 285 | $this->migration->{'post' . ucfirst($direction)}($toSchema); |
| 286 | 286 | |
| 287 | - if (! $dryRun) { |
|
| 287 | + if (!$dryRun) { |
|
| 288 | 288 | if ($direction === self::DIRECTION_UP) { |
| 289 | 289 | $this->markMigrated(); |
| 290 | 290 | } else { |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 326 | + $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 327 | 327 | |
| 328 | 328 | $this->state = self::STATE_NONE; |
| 329 | 329 | |
@@ -386,12 +386,12 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false) |
| 388 | 388 | { |
| 389 | - if (! $dryRun) { |
|
| 389 | + if (!$dryRun) { |
|
| 390 | 390 | if (!empty($this->sql)) { |
| 391 | 391 | foreach ($this->sql as $key => $query) { |
| 392 | 392 | $queryStart = microtime(true); |
| 393 | 393 | |
| 394 | - if ( ! isset($this->params[$key])) { |
|
| 394 | + if (!isset($this->params[$key])) { |
|
| 395 | 395 | $this->outputWriter->write(' <comment>-></comment> ' . $query); |
| 396 | 396 | $this->connection->executeQuery($query); |
| 397 | 397 | } else { |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | public function load() |
| 35 | 35 | { |
| 36 | - foreach($this->loaders as $loader) { |
|
| 36 | + foreach ($this->loaders as $loader) { |
|
| 37 | 37 | if (false !== $confObj = $loader->load()) { |
| 38 | 38 | return $confObj; |
| 39 | 39 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** @var Configuration */ |
| 31 | 31 | private $configuration; |
| 32 | 32 | |
| 33 | - public function __construct(Configuration $configuration=null) |
|
| 33 | + public function __construct(Configuration $configuration = null) |
|
| 34 | 34 | { |
| 35 | 35 | if ($configuration !== null) { |
| 36 | 36 | $this->configuration = $configuration; |