mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-23 18:07:42 +02:00
Use spaceship operator for sorting assoc arrays
This commit is contained in:
parent
28021b61d3
commit
ad6fb35ae1
@ -36,7 +36,7 @@ class DashboardContainer extends NavigationItemContainer
|
||||
public function getDashlets()
|
||||
{
|
||||
uasort($this->dashlets, function (array $x, array $y) {
|
||||
return $x['priority'] - $y['priority'];
|
||||
return $x['priority'] <=> $y['priority'];
|
||||
});
|
||||
|
||||
return $this->dashlets;
|
||||
|
@ -42,7 +42,7 @@ trait DashboardControls
|
||||
// An entry can be added individually afterwards, it might be the case that the priority
|
||||
// order gets mixed up, so we have to sort things here before being able to render them
|
||||
uasort($this->dashboards, function (BaseDashboard $x, BaseDashboard $y) {
|
||||
return $x->getPriority() - $y->getPriority();
|
||||
return $x->getPriority() <=> $y->getPriority();
|
||||
});
|
||||
|
||||
return $this->dashboards;
|
||||
|
@ -44,7 +44,7 @@ abstract class ItemListControl extends BaseHtmlElement
|
||||
abstract protected function createItemList(): BaseHtmlElement;
|
||||
|
||||
/**
|
||||
* Get a drag initiator for this dashlet item
|
||||
* Get a drag initiator for this widget item
|
||||
*
|
||||
* @return ValidHtml
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user