@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $dir = $this->getRealPath($directory); |
| 40 | 40 | |
| 41 | - $files = glob(rtrim($dir, '/') . '/Version*.php'); |
|
| 41 | + $files = glob(rtrim($dir, '/').'/Version*.php'); |
|
| 42 | 42 | |
| 43 | 43 | return $this->loadMigrations($files, $namespace); |
| 44 | 44 | } |
@@ -42,6 +42,6 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | private static function isACustomPharBuild($gitversion) |
| 44 | 44 | { |
| 45 | - return $gitversion !== '@' . 'git-version@'; |
|
| 45 | + return $gitversion !== '@'.'git-version@'; |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | return $this->proxyFactory->createProxy( |
| 72 | 72 | Schema::class, |
| 73 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
| 73 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
| 74 | 74 | $initializer = null; |
| 75 | 75 | $wrappedObject = $originalSchemaManipulator->createFromSchema(); |
| 76 | 76 | |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $originalSchemaManipulator = $this->originalSchemaManipulator; |
| 89 | 89 | |
| 90 | - if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) { |
|
| 90 | + if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) { |
|
| 91 | 91 | return $this->proxyFactory->createProxy( |
| 92 | 92 | Schema::class, |
| 93 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
| 93 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
| 94 | 94 | $initializer = null; |
| 95 | 95 | $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema); |
| 96 | 96 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | public function getSqlDiffToMigrate(Schema $fromSchema, Schema $toSchema) |
| 112 | 112 | { |
| 113 | 113 | if ($toSchema instanceof LazyLoadingInterface |
| 114 | - && ! $toSchema->isProxyInitialized()) { |
|
| 114 | + && !$toSchema->isProxyInitialized()) { |
|
| 115 | 115 | return []; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | //Show normal version number |
| 77 | - return $this->configuration->getDateTime($version) . ' (<comment>' . $version . '</comment>)'; |
|
| 77 | + return $this->configuration->getDateTime($version).' (<comment>'.$version.'</comment>)'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\DBAL\Migrations; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\DBAL\Migrations; |
| 6 | 6 | |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | if (is_array($sql)) { |
| 166 | 166 | foreach ($sql as $key => $query) { |
| 167 | 167 | $this->sql[] = $query; |
| 168 | - if (! empty($params[$key])) { |
|
| 168 | + if (!empty($params[$key])) { |
|
| 169 | 169 | $queryTypes = $types[$key] ?? []; |
| 170 | 170 | $this->addQueryParams($params[$key], $queryTypes); |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | } else { |
| 174 | 174 | $this->sql[] = $sql; |
| 175 | - if (! empty($params)) { |
|
| 175 | + if (!empty($params)) { |
|
| 176 | 176 | $this->addQueryParams($params, $types); |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -202,11 +202,11 @@ discard block |
||
| 202 | 202 | { |
| 203 | 203 | $queries = $this->execute($direction, true); |
| 204 | 204 | |
| 205 | - if (! empty($this->params)) { |
|
| 205 | + if (!empty($this->params)) { |
|
| 206 | 206 | throw MigrationException::migrationNotConvertibleToSql($this->class); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - $this->outputWriter->write("\n-- Version " . $this->version . "\n"); |
|
| 209 | + $this->outputWriter->write("\n-- Version ".$this->version."\n"); |
|
| 210 | 210 | |
| 211 | 211 | $sqlQueries = [$this->version => $queries]; |
| 212 | 212 | |
@@ -259,12 +259,12 @@ discard block |
||
| 259 | 259 | $this->state = self::STATE_PRE; |
| 260 | 260 | $fromSchema = $this->schemaProvider->createFromSchema(); |
| 261 | 261 | |
| 262 | - $this->migration->{'pre' . ucfirst($direction)}($fromSchema); |
|
| 262 | + $this->migration->{'pre'.ucfirst($direction)}($fromSchema); |
|
| 263 | 263 | |
| 264 | 264 | if ($direction === self::DIRECTION_UP) { |
| 265 | - $this->outputWriter->write("\n" . sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n"); |
|
| 265 | + $this->outputWriter->write("\n".sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version)."\n"); |
|
| 266 | 266 | } else { |
| 267 | - $this->outputWriter->write("\n" . sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n"); |
|
| 267 | + $this->outputWriter->write("\n".sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version)."\n"); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | $this->state = self::STATE_EXEC; |
@@ -277,9 +277,9 @@ discard block |
||
| 277 | 277 | $this->executeRegisteredSql($dryRun, $timeAllQueries); |
| 278 | 278 | |
| 279 | 279 | $this->state = self::STATE_POST; |
| 280 | - $this->migration->{'post' . ucfirst($direction)}($toSchema); |
|
| 280 | + $this->migration->{'post'.ucfirst($direction)}($toSchema); |
|
| 281 | 281 | |
| 282 | - if (! $dryRun) { |
|
| 282 | + if (!$dryRun) { |
|
| 283 | 283 | if ($direction === self::DIRECTION_UP) { |
| 284 | 284 | $this->markMigrated(); |
| 285 | 285 | } else { |
@@ -387,13 +387,13 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false) |
| 389 | 389 | { |
| 390 | - if (! $dryRun) { |
|
| 391 | - if (! empty($this->sql)) { |
|
| 390 | + if (!$dryRun) { |
|
| 391 | + if (!empty($this->sql)) { |
|
| 392 | 392 | foreach ($this->sql as $key => $query) { |
| 393 | 393 | $queryStart = microtime(true); |
| 394 | 394 | |
| 395 | - if (! isset($this->params[$key])) { |
|
| 396 | - $this->outputWriter->write(' <comment>-></comment> ' . $query); |
|
| 395 | + if (!isset($this->params[$key])) { |
|
| 396 | + $this->outputWriter->write(' <comment>-></comment> '.$query); |
|
| 397 | 397 | $this->connection->executeQuery($query); |
| 398 | 398 | } else { |
| 399 | 399 | $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query)); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * migrations. |
| 119 | 119 | */ |
| 120 | 120 | $migrations = $this->configuration->getMigrations(); |
| 121 | - if (! isset($migrations[$to]) && $to > 0) { |
|
| 121 | + if (!isset($migrations[$to]) && $to > 0) { |
|
| 122 | 122 | throw MigrationException::unknownMigrationVersion($to); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | * means we are already at the destination return an empty array() |
| 134 | 134 | * to signify that there is nothing left to do. |
| 135 | 135 | */ |
| 136 | - if ($from === $to && empty($migrationsToExecute) && ! empty($migrations)) { |
|
| 136 | + if ($from === $to && empty($migrationsToExecute) && !empty($migrations)) { |
|
| 137 | 137 | return $this->noMigrations(); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if (! $dryRun && $this->migrationsCanExecute($confirm) === false) { |
|
| 140 | + if (!$dryRun && $this->migrationsCanExecute($confirm) === false) { |
|
| 141 | 141 | return []; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | /** |
| 149 | 149 | * If there are no migrations to execute throw an exception. |
| 150 | 150 | */ |
| 151 | - if (empty($migrationsToExecute) && ! $this->noMigrationException) { |
|
| 151 | + if (empty($migrationsToExecute) && !$this->noMigrationException) { |
|
| 152 | 152 | throw MigrationException::noMigrationsToExecute(); |
| 153 | 153 | } elseif (empty($migrationsToExecute)) { |
| 154 | 154 | return $this->noMigrations(); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function onMigrationsMigrated(MigrationsEventArgs $args) |
| 16 | 16 | { |
| 17 | 17 | $conn = $args->getConnection(); |
| 18 | - if (! $args->isDryRun() && ! $conn->isAutoCommit()) { |
|
| 18 | + if (!$args->isDryRun() && !$conn->isAutoCommit()) { |
|
| 19 | 19 | $conn->commit(); |
| 20 | 20 | } |
| 21 | 21 | } |