Fix stripping ".git" from dir names
[phorkie.git] / src / phorkie / Repositories.php
index 9021a2e1a549cfe2e5dd4bc754c104982c5c27f2..c6059961a3f6ed2b2124276729698ab4ef46fd37 100644 (file)
@@ -16,13 +16,11 @@ class Repositories
     {
         chdir($this->gitDir);
         $dirs = glob('*.git', GLOB_ONLYDIR);
-        array_walk(
-            $dirs,
-            function ($dir) {
-                return substr($dir, 0, -4);
-            }
-        );
+        foreach ($dirs as $key => $dir) {
+            $dirs[$key] = substr($dir, 0, -4);
+        }
         sort($dirs, SORT_NUMERIC);
+
         if ($GLOBALS['phorkie']['cfg']['randomIds']) {
             $n = end($dirs) + mt_rand(65536, 16777216);
         } else {