You are here

public function SystemManager::getMaxSeverity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/SystemManager.php \Drupal\system\SystemManager::getMaxSeverity()
  2. 9 core/modules/system/src/SystemManager.php \Drupal\system\SystemManager::getMaxSeverity()

Extracts the highest severity from the requirements array.

Parameters

$requirements: An array of requirements, in the same format as is returned by hook_requirements().

Return value

The highest severity in the array.

File

core/modules/system/src/SystemManager.php, line 133

Class

SystemManager
System Manager Service.

Namespace

Drupal\system

Code

public function getMaxSeverity(&$requirements) {
  $severity = static::REQUIREMENT_OK;
  foreach ($requirements as $requirement) {
    if (isset($requirement['severity'])) {
      $severity = max($severity, $requirement['severity']);
    }
  }
  return $severity;
}