@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | * the value is the migration class name. |
| 420 | 420 | * |
| 421 | 421 | * |
| 422 | - * @param array $migrations |
|
| 422 | + * @param string[] $migrations |
|
| 423 | 423 | * |
| 424 | 424 | * @return Version[] |
| 425 | 425 | */ |
@@ -587,6 +587,8 @@ discard block |
||
| 587 | 587 | /** |
| 588 | 588 | * Returns the version with the specified offset to the specified version. |
| 589 | 589 | * |
| 590 | + * @param string $version |
|
| 591 | + * @param integer $delta |
|
| 590 | 592 | * @return string|null A version string, or null if the specified version |
| 591 | 593 | * is unknown or the specified delta is not within the |
| 592 | 594 | * list of available versions. |
@@ -763,7 +765,7 @@ discard block |
||
| 763 | 765 | * Find all the migrations in a given directory. |
| 764 | 766 | * |
| 765 | 767 | * @param string $path the directory to search. |
| 766 | - * @return array |
|
| 768 | + * @return string[] |
|
| 767 | 769 | */ |
| 768 | 770 | protected function findMigrations($path) |
| 769 | 771 | { |
@@ -813,9 +815,9 @@ discard block |
||
| 813 | 815 | * @param string $direction The direction we are migrating. |
| 814 | 816 | * @param Version $version The Version instance to check. |
| 815 | 817 | * @param string $to The version we are migrating to. |
| 816 | - * @param array $migrated Migrated versions array. |
|
| 818 | + * @param Version[] $migrated Migrated versions array. |
|
| 817 | 819 | * |
| 818 | - * @return boolean |
|
| 820 | + * @return boolean|null |
|
| 819 | 821 | */ |
| 820 | 822 | private function shouldExecuteMigration($direction, Version $version, $to, $migrated) |
| 821 | 823 | { |
@@ -102,6 +102,10 @@ discard block |
||
| 102 | 102 | /** @var SchemaDiffProviderInterface */ |
| 103 | 103 | private $schemaProvider; |
| 104 | 104 | |
| 105 | + /** |
|
| 106 | + * @param string $version |
|
| 107 | + * @param string $class |
|
| 108 | + */ |
|
| 105 | 109 | public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider=null) |
| 106 | 110 | { |
| 107 | 111 | $this->configuration = $configuration; |
@@ -156,6 +160,9 @@ discard block |
||
| 156 | 160 | $this->markVersion('up'); |
| 157 | 161 | } |
| 158 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string $direction |
|
| 165 | + */ |
|
| 159 | 166 | private function markVersion($direction) |
| 160 | 167 | { |
| 161 | 168 | $action = $direction === 'up' ? 'insert' : 'delete'; |
@@ -214,7 +221,7 @@ discard block |
||
| 214 | 221 | * @param string $path The path to write the migration SQL file. |
| 215 | 222 | * @param string $direction The direction to execute. |
| 216 | 223 | * |
| 217 | - * @return boolean $written |
|
| 224 | + * @return integer $written |
|
| 218 | 225 | */ |
| 219 | 226 | public function writeSqlFile($path, $direction = self::DIRECTION_UP) |
| 220 | 227 | { |
@@ -371,6 +378,9 @@ discard block |
||
| 371 | 378 | } |
| 372 | 379 | } |
| 373 | 380 | |
| 381 | + /** |
|
| 382 | + * @param double $queryStart |
|
| 383 | + */ |
|
| 374 | 384 | private function outputQueryTime($queryStart, $timeAllQueries = false) |
| 375 | 385 | { |
| 376 | 386 | if ($timeAllQueries !== false) { |
@@ -384,7 +394,7 @@ discard block |
||
| 384 | 394 | /** |
| 385 | 395 | * Returns the time this migration version took to execute |
| 386 | 396 | * |
| 387 | - * @return integer $time The time this migration version took to execute |
|
| 397 | + * @return double $time The time this migration version took to execute |
|
| 388 | 398 | */ |
| 389 | 399 | public function getTime() |
| 390 | 400 | { |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | use Doctrine\DBAL\Migrations\Provider\LazySchemaDiffProvider; |
| 24 | 24 | use Doctrine\DBAL\Migrations\Provider\SchemaDiffProvider; |
| 25 | 25 | use Doctrine\DBAL\Migrations\Provider\SchemaDiffProviderInterface; |
| 26 | -use ProxyManager\Factory\LazyLoadingValueHolderFactory; |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * Class which wraps a migration version and allows execution of the |
@@ -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 = LazySchemaDiffProvider::fromDefaultProxyFacyoryConfiguration($schemaProvider); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $this->state = self::STATE_POST; |
| 297 | 297 | $this->migration->{'post' . ucfirst($direction)}($toSchema); |
| 298 | 298 | |
| 299 | - if (! $dryRun) { |
|
| 299 | + if (!$dryRun) { |
|
| 300 | 300 | if ($direction === self::DIRECTION_UP) { |
| 301 | 301 | $this->markMigrated(); |
| 302 | 302 | } else { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 338 | + $this->outputWriter->write(sprintf("\n <info>SS</info> skipped (Reason: %s)", $e->getMessage())); |
|
| 339 | 339 | |
| 340 | 340 | $this->state = self::STATE_NONE; |
| 341 | 341 | |
@@ -398,12 +398,12 @@ discard block |
||
| 398 | 398 | |
| 399 | 399 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false) |
| 400 | 400 | { |
| 401 | - if (! $dryRun) { |
|
| 401 | + if (!$dryRun) { |
|
| 402 | 402 | if (!empty($this->sql)) { |
| 403 | 403 | foreach ($this->sql as $key => $query) { |
| 404 | 404 | $queryStart = microtime(true); |
| 405 | 405 | |
| 406 | - if ( ! isset($this->params[$key])) { |
|
| 406 | + if (!isset($this->params[$key])) { |
|
| 407 | 407 | $this->outputWriter->write(' <comment>-></comment> ' . $query); |
| 408 | 408 | $this->connection->executeQuery($query); |
| 409 | 409 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $this->configuration = $this->getMigrationConfiguration($input, $output); |
| 94 | 94 | |
| 95 | - if ( ! $input->getOption('add') && ! $input->getOption('delete')) { |
|
| 95 | + if (!$input->getOption('add') && !$input->getOption('delete')) { |
|
| 96 | 96 | throw new \InvalidArgumentException('You must specify whether you want to --add or --delete the specified version.'); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -149,26 +149,26 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | private function mark($version, $all = false) |
| 151 | 151 | { |
| 152 | - if ( ! $this->configuration->hasVersion($version)) { |
|
| 152 | + if (!$this->configuration->hasVersion($version)) { |
|
| 153 | 153 | throw MigrationException::unknownMigrationVersion($version); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $version = $this->configuration->getVersion($version); |
| 157 | 157 | if ($this->markMigrated && $this->configuration->hasVersionMigrated($version)) { |
| 158 | - if (! $all) { |
|
| 158 | + if (!$all) { |
|
| 159 | 159 | throw new \InvalidArgumentException(sprintf('The version "%s" already exists in the version table.', $version)); |
| 160 | 160 | } |
| 161 | 161 | $marked = true; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - if ( ! $this->markMigrated && ! $this->configuration->hasVersionMigrated($version)) { |
|
| 165 | - if (! $all) { |
|
| 164 | + if (!$this->markMigrated && !$this->configuration->hasVersionMigrated($version)) { |
|
| 165 | + if (!$all) { |
|
| 166 | 166 | throw new \InvalidArgumentException(sprintf('The version "%s" does not exists in the version table.', $version)); |
| 167 | 167 | } |
| 168 | 168 | $marked = false; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - if ( ! isset($marked)) { |
|
| 171 | + if (!isset($marked)) { |
|
| 172 | 172 | if ($this->markMigrated) { |
| 173 | 173 | $version->markMigrated(); |
| 174 | 174 | } else { |