mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-23 09:57:58 +02:00
Use spaceship operator for sorting assoc arrays
This commit is contained in:
parent
7b22be2b28
commit
c71f738b31
@ -36,7 +36,7 @@ class DashboardContainer extends NavigationItemContainer
|
|||||||
public function getDashlets()
|
public function getDashlets()
|
||||||
{
|
{
|
||||||
uasort($this->dashlets, function (array $x, array $y) {
|
uasort($this->dashlets, function (array $x, array $y) {
|
||||||
return $x['priority'] - $y['priority'];
|
return $x['priority'] <=> $y['priority'];
|
||||||
});
|
});
|
||||||
|
|
||||||
return $this->dashlets;
|
return $this->dashlets;
|
||||||
|
@ -42,7 +42,7 @@ trait DashboardControls
|
|||||||
// An entry can be added individually afterwards, it might be the case that the priority
|
// 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
|
// 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) {
|
uasort($this->dashboards, function (BaseDashboard $x, BaseDashboard $y) {
|
||||||
return $x->getPriority() - $y->getPriority();
|
return $x->getPriority() <=> $y->getPriority();
|
||||||
});
|
});
|
||||||
|
|
||||||
return $this->dashboards;
|
return $this->dashboards;
|
||||||
|
@ -44,7 +44,7 @@ abstract class ItemListControl extends BaseHtmlElement
|
|||||||
abstract protected function createItemList(): BaseHtmlElement;
|
abstract protected function createItemList(): BaseHtmlElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a drag initiator for this dashlet item
|
* Get a drag initiator for this widget item
|
||||||
*
|
*
|
||||||
* @return ValidHtml
|
* @return ValidHtml
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user