You are here

public function SystemManager::getMaxSeverity in Drupal 8

Same name and namespace in other branches
  1. 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.

1 call to SystemManager::getMaxSeverity()
SystemManager::checkRequirements in core/modules/system/src/SystemManager.php
Checks for requirement severity.

File

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

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;
}