fix broken array with sort function

master
Jean-Christian Paul Denis 2023-05-13 17:24:44 +02:00
parent 908abd74c9
commit 399d675a04
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
3 changed files with 3 additions and 8 deletions

View File

@ -58,11 +58,8 @@ class Plugins extends CleanerParent
public function values(): array
{
$dirs = self::getDirs(DC_PLUGINS_ROOT);
sort($dirs);
$stack = [];
foreach ($dirs as $path => $count) {
foreach (self::getDirs(DC_PLUGINS_ROOT) as $path => $count) {
$stack[] = new ValueDescriptor(
ns: $path,
count: $count

View File

@ -63,11 +63,8 @@ class Themes extends CleanerParent
return [];
}
$dirs = self::getDirs($path);
sort($dirs);
$stack = [];
foreach ($dirs as $path => $count) {
foreach ($dirs = self::getDirs($path) as $path => $count) {
$stack[] = new ValueDescriptor(
ns: $path,
count: $count

View File

@ -58,6 +58,7 @@ trait DirTrait
$stack[$k] = count(self::scanDir($path . DIRECTORY_SEPARATOR . $k));
}
}
ksort($stack);
return $stack;
}