1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-06-10 08:05:49 +02:00

fix: sort logic (#780)

This commit is contained in:
snmatsui 2025-05-12 17:34:13 +09:00 committed by GitHub
parent 8e0abc30b9
commit 828db761ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1257,8 +1257,8 @@ class JavascriptRenderer
$controls = array_merge($widgets, $this->controls);
// Allow widgets to be sorted by order if specified
uasort($controls, function(array $control){
return $control['order'] ?? 0;
uasort($controls, function(array $controlA, array $controlB){
return ($controlA['order'] ?? 0) <=> ($controlB['order'] ?? 0);
});
foreach (array_filter($controls) as $name => $options) {