Browse code

sort repository list case insensitive. also use the more appropriate ksort function as we do not want to sort by key value

Nico Mandery authored on 19/05/2014 09:28:31
Showing 1 changed files
... ...
@@ -28,7 +28,8 @@ class Client extends BaseClient
28 28
      * Searches for valid repositories on the specified path
29 29
      *
30 30
      * @param  array $paths Array of paths where repositories will be searched
31
-     * @return array Found repositories, containing their name, path and description
31
+     * @return array Found repositories, containing their name, path and description sorted
32
+     *               by repository name
32 33
      */
33 34
     public function getRepositories($paths)
34 35
     {
... ...
@@ -45,7 +46,7 @@ class Client extends BaseClient
45 45
         }
46 46
 
47 47
         $allRepositories = array_unique($allRepositories, SORT_REGULAR);
48
-        asort($allRepositories);
48
+        ksort($allRepositories, SORT_STRING | SORT_FLAG_CASE);
49 49
 
50 50
         return $allRepositories;
51 51
     }