X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCheck.php;h=c53912830e2962f9bbf3dc3e272459e8962fde2c;hb=4b4b8a02477c56182c8df6def1ba14987033dd65;hp=0c124a71c239e3d853ced423cdd73cf71646cda0;hpb=ce0d67d6a686fcfae1d7046e615107f25cec501a;p=civicrm-core.git diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index 0c124a71c2..c53912830e 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -116,23 +116,6 @@ class CRM_Utils_Check { } } - /** - * Sort messages based upon severity - * - * @param CRM_Utils_Check_Message $a - * @param CRM_Utils_Check_Message $b - * @return int - */ - public static function severitySort($a, $b) { - $aSeverity = $a->getLevel(); - $bSeverity = $b->getLevel(); - if ($aSeverity == $bSeverity) { - return strcmp($a->getName(), $b->getName()); - } - // The Message constructor guarantees that these will always be integers. - return ($aSeverity <=> $bSeverity); - } - /** * Get the integer value (useful for thresholds) of the severity. * @@ -201,15 +184,11 @@ class CRM_Utils_Check { public static function checkAll($max = FALSE) { $messages = self::checkStatus(); - uasort($messages, [__CLASS__, 'severitySort']); - $maxSeverity = 1; foreach ($messages as $message) { - if (!$message->isVisible()) { - continue; + if ($message->isVisible()) { + $maxSeverity = max($maxSeverity, $message->getLevel()); } - $maxSeverity = max(1, $message->getLevel()); - break; } Civi::cache('checks')->set('systemStatusCheckResult', $maxSeverity);