Skip to content

Commit 828db76

Browse files
authored
fix: sort logic (php-debugbar#780)
1 parent 8e0abc3 commit 828db76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DebugBar/JavascriptRenderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,8 @@ protected function getJsControlsDefinitionCode($varname)
12571257
$controls = array_merge($widgets, $this->controls);
12581258

12591259
// Allow widgets to be sorted by order if specified
1260-
uasort($controls, function(array $control){
1261-
return $control['order'] ?? 0;
1260+
uasort($controls, function(array $controlA, array $controlB){
1261+
return ($controlA['order'] ?? 0) <=> ($controlB['order'] ?? 0);
12621262
});
12631263

12641264
foreach (array_filter($controls) as $name => $options) {

0 commit comments

Comments
 (0)