fix broken array with sort function

This commit is contained in:
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 public function values(): array
{ {
$dirs = self::getDirs(DC_PLUGINS_ROOT);
sort($dirs);
$stack = []; $stack = [];
foreach ($dirs as $path => $count) { foreach (self::getDirs(DC_PLUGINS_ROOT) as $path => $count) {
$stack[] = new ValueDescriptor( $stack[] = new ValueDescriptor(
ns: $path, ns: $path,
count: $count count: $count

View File

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

View File

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