From a2df66bee954b8a4c9d9256fd1b6468488e6d9e2 Mon Sep 17 00:00:00 2001 From: Nico Mandery Date: Mon, 19 May 2014 11:28:31 +0200 Subject: [PATCH] sort repository list case insensitive. also use the more appropriate ksort function as we do not want to sort by key value --- src/GitList/Git/Client.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GitList/Git/Client.php b/src/GitList/Git/Client.php index 1547d53..2702d33 100644 --- a/src/GitList/Git/Client.php +++ b/src/GitList/Git/Client.php @@ -28,7 +28,8 @@ class Client extends BaseClient * Searches for valid repositories on the specified path * * @param array $paths Array of paths where repositories will be searched - * @return array Found repositories, containing their name, path and description + * @return array Found repositories, containing their name, path and description sorted + * by repository name */ public function getRepositories($paths) { @@ -45,7 +46,7 @@ class Client extends BaseClient } $allRepositories = array_unique($allRepositories, SORT_REGULAR); - asort($allRepositories); + ksort($allRepositories, SORT_STRING | SORT_FLAG_CASE); return $allRepositories; }