function SystemManager::getMaxSeverity

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

Extracts the highest severity from the requirements array.

Parameters

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

Return value

int The highest severity in the array.

Deprecated

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Extension\Requirement\RequirementSeverity::getMaxSeverity() instead.

See also

https://www.drupal.org/node/3410939

File

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

Class

SystemManager
System Manager Service.

Namespace

Drupal\system

Code

public function getMaxSeverity(&$requirements) {
  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use ' . RequirementSeverity::class . '::maxSeverityFromRequirements() instead. See https://www.drupal.org/node/3410939', \E_USER_DEPRECATED);
  return RequirementSeverity::maxSeverityFromRequirements($requirements)->value;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.