| @@ -12,9 +12,9 @@ | ||
| 12 | 12 | * @package Give\MigrationLog\Helpers |
| 13 | 13 | * |
| 14 | 14 | * Helper class used to get migration data |
| 15 | 15 | * |
| 16 | - * @since 2.10.0 | |
| 16 | + * @since 2.10.0 | |
| 17 | 17 | */ |
| 18 | 18 | class MigrationHelper |
| 19 | 19 | { |
| 20 | 20 | |
| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * MigrationOrder constructor. |
| 38 | 38 | * |
| 39 | - * @param MigrationsRegister $migrationRegister | |
| 39 | + * @param MigrationsRegister $migrationRegister | |
| 40 | 40 | * @param MigrationLogRepository $migrationRepository |
| 41 | 41 | */ |
| 42 | 42 | public function __construct( |
| 43 | 43 | MigrationsRegister $migrationRegister, |
| @@ -60,12 +60,12 @@ | ||
| 60 | 60 | |
| 61 | 61 | if (empty($migrations)) { |
| 62 | 62 | /* @var Migration $migrationClass */ |
| 63 | 63 | foreach ($this->migrationRegister->getMigrations() as $migrationClass) { |
| 64 | - $migrations[$migrationClass::timestamp() . '_' . $migrationClass::id()] = $migrationClass::id(); | |
| 64 | + $migrations[$migrationClass::id()] = $migrationClass::timestamp(); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - ksort($migrations); | |
| 67 | + asort($migrations); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return $migrations; |
| 71 | 71 | } |
| @@ -104,9 +104,9 @@ | ||
| 104 | 104 | * @return int |
| 105 | 105 | */ |
| 106 | 106 | public function getRunOrderForMigration($migrationId) |
| 107 | 107 | { |
| 108 | - return array_search($migrationId, array_values($this->getMigrationsSorted())) + 1; | |
| 108 | + return array_search($migrationId, array_keys($this->getMigrationsSorted())) + 1; | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * Retrieves the migrations from the database, caching the results for future retrieval |