File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,8 @@ public static function getInstalledStandards(
180
180
// Check if the installed dir is actually a standard itself.
181
181
$ csFile = $ standardsDir .'/ruleset.xml ' ;
182
182
if (is_file ($ csFile ) === true ) {
183
- $ installedStandards [] = basename ($ standardsDir );
183
+ $ basename = basename ($ standardsDir );
184
+ $ installedStandards [$ basename ] = $ basename ;
184
185
continue ;
185
186
}
186
187
@@ -190,6 +191,7 @@ public static function getInstalledStandards(
190
191
}
191
192
192
193
$ di = new \DirectoryIterator ($ standardsDir );
194
+ $ standardsInDir = [];
193
195
foreach ($ di as $ file ) {
194
196
if ($ file ->isDir () === true && $ file ->isDot () === false ) {
195
197
$ filename = $ file ->getFilename ();
@@ -202,10 +204,13 @@ public static function getInstalledStandards(
202
204
// Valid coding standard dirs include a ruleset.
203
205
$ csFile = $ file ->getPathname ().'/ruleset.xml ' ;
204
206
if (is_file ($ csFile ) === true ) {
205
- $ installedStandards [ ] = $ filename ;
207
+ $ standardsInDir [ $ filename ] = $ filename ;
206
208
}
207
209
}
208
210
}
211
+
212
+ natsort ($ standardsInDir );
213
+ $ installedStandards += $ standardsInDir ;
209
214
}//end foreach
210
215
211
216
return $ installedStandards ;
You can’t perform that action at this time.
0 commit comments