$directoryIterator =
new DirectoryIterator($migrationPath);
$regex =
new RegexIterator($directoryIterator,
$regexPattern, RecursiveRegexIterator::GET_MATCH
);
$migrations =
[];
foreach ($regex as $result) { $migrationVersion =
$result['1'
];
if ($migrationVersion <=
$currentVersion) { continue;
} $migrationClass =
$this->
loadMigration($result,
$migrationPath);
$migrations[$migrationClass->
getVersion()] =
$migrationClass;
} ksort($migrations);
if ($limit !== null
) { return \
array_slice($migrations, 0,
$limit, true
);
} return $migrations;
}