mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Sort models found in file system (#982)
Ensures they're always ordered / processed independent of the environment. `ClassMapGenerator::createMap` uses symfony/finder which itself supports sorting but this isn't used from the `ClassMapGenerator`. Fixes https://github.com/barryvdh/laravel-ide-helper/issues/885
This commit is contained in:
@@ -276,7 +276,12 @@ class ModelsCommand extends Command
|
||||
$dirs = glob($dir, GLOB_ONLYDIR);
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($dir)) {
|
||||
foreach (ClassMapGenerator::createMap($dir) as $model => $path) {
|
||||
$classMap = ClassMapGenerator::createMap($dir);
|
||||
|
||||
// Sort list so it's stable across different environments
|
||||
ksort($classMap);
|
||||
|
||||
foreach ($classMap as $model => $path) {
|
||||
$models[] = $model;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user