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(
180180 // Check if the installed dir is actually a standard itself.
181181 $ csFile = $ standardsDir .'/ruleset.xml ' ;
182182 if (is_file ($ csFile ) === true ) {
183- $ installedStandards [] = basename ($ standardsDir );
183+ $ basename = basename ($ standardsDir );
184+ $ installedStandards [$ basename ] = $ basename ;
184185 continue ;
185186 }
186187
@@ -190,6 +191,7 @@ public static function getInstalledStandards(
190191 }
191192
192193 $ di = new \DirectoryIterator ($ standardsDir );
194+ $ standardsInDir = [];
193195 foreach ($ di as $ file ) {
194196 if ($ file ->isDir () === true && $ file ->isDot () === false ) {
195197 $ filename = $ file ->getFilename ();
@@ -202,10 +204,13 @@ public static function getInstalledStandards(
202204 // Valid coding standard dirs include a ruleset.
203205 $ csFile = $ file ->getPathname ().'/ruleset.xml ' ;
204206 if (is_file ($ csFile ) === true ) {
205- $ installedStandards [ ] = $ filename ;
207+ $ standardsInDir [ $ filename ] = $ filename ;
206208 }
207209 }
208210 }
211+
212+ natsort ($ standardsInDir );
213+ $ installedStandards += $ standardsInDir ;
209214 }//end foreach
210215
211216 return $ installedStandards ;
You can’t perform that action at this time.
0 commit comments