Skip to content
Snippets Groups Projects
Unverified Commit 7e7347bd authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #20502 from seamuslee001/spaceship

[php8-compat] Fix issue with returning bool from uasort by using the …
parents 005fa8c6 11d593ed
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {
if (!isset($a['dashboard_contact.weight'])) {
return 1;
}
return $a['dashboard_contact.weight'] > $b['dashboard_contact.weight'];
return $a['dashboard_contact.weight'] <=> $b['dashboard_contact.weight'];
});
}
return Civi::$statics[__CLASS__][__FUNCTION__][$cid] ?? [];
......
......@@ -114,7 +114,7 @@ class CRM_Utils_Check {
return strcmp($a->getName(), $b->getName());
}
// The Message constructor guarantees that these will always be integers.
return ($aSeverity < $bSeverity);
return ($aSeverity <=> $bSeverity);
}
/**
......
......@@ -615,7 +615,7 @@ function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour,
* @return bool
*/
function _civicrm_api3_order_by_weight($a, $b) {
return ($b['weight'] ?? 0) < ($a['weight'] ?? 0);
return ($b['weight'] ?? 0) < ($a['weight'] ?? 0) ? 1 : -1;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment