Description
Bug Report
Q | A |
---|---|
BC Break | no |
Version | 3.1.4 |
Summary
The order of loaded migrations on the abstract MigrationFinder is misleading and probably not as intended.
Current behavior
In Doctrine\Migrations\Finder\Finder::loadMigrations() migration classes are loaded by submitted migration files.
After loading the classes they are iterated and transferred into the $versions Array.
The $versions array is then sorted by key with SORT_STRING option and returned.
As the array is sorted by key with SORT_STRING option and you have more than 10 migrations, the returned versions array will be in misleading order as follows:
[0] => Version 0
[1] => Version 1
[10] => Version 10
[11] => Version 11
[2] => Version 2
The screenshot shows the unsorted version array and the sorted one.
How to reproduce
Add more than 10 migrations to your project and dump the output of loadMigrations()
Expected behavior
I would expect the returned array to be sorted by the version number or not sorted at all.