@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function validate() |
195 | 195 | { |
196 | - if ( ! $this->migrationsNamespace) { |
|
196 | + if (!$this->migrationsNamespace) { |
|
197 | 197 | throw MigrationException::migrationsNamespaceRequired(); |
198 | 198 | } |
199 | - if ( ! $this->migrationsDirectory) { |
|
199 | + if (!$this->migrationsDirectory) { |
|
200 | 200 | throw MigrationException::migrationsDirectoryRequired(); |
201 | 201 | } |
202 | 202 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | public function setMigrationsFinder(MigrationFinderInterface $finder) |
392 | 392 | { |
393 | 393 | if (($this->migrationsAreOrganizedByYear || $this->migrationsAreOrganizedByYearAndMonth) |
394 | - && ! ($finder instanceof MigrationDeepFinderInterface)) { |
|
394 | + && !($finder instanceof MigrationDeepFinderInterface)) { |
|
395 | 395 | throw MigrationException::configurationIncompatibleWithFinder( |
396 | 396 | 'organize-migrations', |
397 | 397 | $finder |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $this->registerMigrationsFromDirectory($this->getMigrationsDirectory()); |
489 | 489 | } |
490 | 490 | |
491 | - if ( ! isset($this->migrations[$version])) { |
|
491 | + if (!isset($this->migrations[$version])) { |
|
492 | 492 | throw MigrationException::unknownMigrationVersion($version); |
493 | 493 | } |
494 | 494 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | $this->createMigrationTable(); |
525 | 525 | |
526 | 526 | $version = $this->connection->fetchColumn( |
527 | - "SELECT " . $this->migrationsColumnName . " FROM " . $this->migrationsTableName . " WHERE " . $this->migrationsColumnName . " = ?", |
|
527 | + "SELECT ".$this->migrationsColumnName." FROM ".$this->migrationsTableName." WHERE ".$this->migrationsColumnName." = ?", |
|
528 | 528 | [$version->getVersion()] |
529 | 529 | ); |
530 | 530 | |
@@ -540,13 +540,13 @@ discard block |
||
540 | 540 | { |
541 | 541 | $this->createMigrationTable(); |
542 | 542 | |
543 | - if ( ! $this->migrationTableCreated && $this->isDryRun) { |
|
543 | + if (!$this->migrationTableCreated && $this->isDryRun) { |
|
544 | 544 | return []; |
545 | 545 | } |
546 | 546 | |
547 | 547 | $this->connect(); |
548 | 548 | |
549 | - $ret = $this->connection->fetchAll("SELECT " . $this->migrationsColumnName . " FROM " . $this->migrationsTableName); |
|
549 | + $ret = $this->connection->fetchAll("SELECT ".$this->migrationsColumnName." FROM ".$this->migrationsTableName); |
|
550 | 550 | |
551 | 551 | return array_map('current', $ret); |
552 | 552 | } |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | { |
581 | 581 | $this->createMigrationTable(); |
582 | 582 | |
583 | - if ( ! $this->migrationTableCreated && $this->isDryRun) { |
|
583 | + if (!$this->migrationTableCreated && $this->isDryRun) { |
|
584 | 584 | return '0'; |
585 | 585 | } |
586 | 586 | |
@@ -591,12 +591,12 @@ discard block |
||
591 | 591 | } |
592 | 592 | |
593 | 593 | $where = null; |
594 | - if ( ! empty($this->migrations)) { |
|
594 | + if (!empty($this->migrations)) { |
|
595 | 595 | $migratedVersions = []; |
596 | 596 | foreach ($this->migrations as $migration) { |
597 | 597 | $migratedVersions[] = sprintf("'%s'", $migration->getVersion()); |
598 | 598 | } |
599 | - $where = " WHERE " . $this->migrationsColumnName . " IN (" . implode(', ', $migratedVersions) . ")"; |
|
599 | + $where = " WHERE ".$this->migrationsColumnName." IN (".implode(', ', $migratedVersions).")"; |
|
600 | 600 | } |
601 | 601 | |
602 | 602 | $sql = sprintf( |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $versions = array_map('strval', array_keys($this->migrations)); |
654 | 654 | array_unshift($versions, '0'); |
655 | 655 | $offset = array_search((string) $version, $versions); |
656 | - if ($offset === false || ! isset($versions[$offset + $delta])) { |
|
656 | + if ($offset === false || !isset($versions[$offset + $delta])) { |
|
657 | 657 | // Unknown version or delta out of bounds. |
658 | 658 | return null; |
659 | 659 | } |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $this->connect(); |
737 | 737 | $this->createMigrationTable(); |
738 | 738 | |
739 | - $result = $this->connection->fetchColumn("SELECT COUNT(" . $this->migrationsColumnName . ") FROM " . $this->migrationsTableName); |
|
739 | + $result = $this->connection->fetchColumn("SELECT COUNT(".$this->migrationsColumnName.") FROM ".$this->migrationsTableName); |
|
740 | 740 | |
741 | 741 | return $result !== false ? $result : 0; |
742 | 742 | } |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | */ |
927 | 927 | private function ensureOrganizeMigrationsIsCompatibleWithFinder() |
928 | 928 | { |
929 | - if ( ! ($this->migrationFinder instanceof MigrationDeepFinderInterface)) { |
|
929 | + if (!($this->migrationFinder instanceof MigrationDeepFinderInterface)) { |
|
930 | 930 | throw MigrationException::configurationIncompatibleWithFinder( |
931 | 931 | 'organize-migrations', |
932 | 932 | $this->migrationFinder |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | private function shouldExecuteMigration($direction, Version $version, $to, $migrated) |
949 | 949 | { |
950 | 950 | if ($direction === Version::DIRECTION_DOWN) { |
951 | - if ( ! in_array($version->getVersion(), $migrated)) { |
|
951 | + if (!in_array($version->getVersion(), $migrated)) { |
|
952 | 952 | return false; |
953 | 953 | } |
954 | 954 | |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | */ |
971 | 971 | private function ensureMigrationClassExists($class) |
972 | 972 | { |
973 | - if ( ! class_exists($class)) { |
|
973 | + if (!class_exists($class)) { |
|
974 | 974 | throw MigrationException::migrationClassNotFound($class, $this->getMigrationsNamespace()); |
975 | 975 | } |
976 | 976 | } |