/** * InMemoryMigrationStore constructor. */ public function __construct() { $this->store = new SortedArrayHashMap([], Comparator::from(function ($a, $b) { // order desc return -1 * Version::fromString($a)->compareTo(Version::fromString($b)); })); }
/** * MigrationManager constructor. * * @param MigrationStoreInterface $migrationStore * @param string $migrationsDirectory */ public function __construct(MigrationStoreInterface $migrationStore, $migrationsDirectory) { $this->migrationStore = $migrationStore; $this->migrationsDirectory = $migrationsDirectory; $this->migrationsInFile = new SortedArrayHashMap([], Comparator::from(function ($v1, $v2) { return Version::fromString($v1)->compareTo(Version::fromString($v2)); })); }