You are here

protected function ReadinessCheckerManager::getSortedCheckers in Automatic Updates 8

Sorts checkers according to priority.

Return value

\Drupal\automatic_updates\ReadinessChecker\ReadinessCheckerInterface[] A sorted array of checker objects.

File

src/ReadinessChecker/ReadinessCheckerManager.php, line 124

Class

ReadinessCheckerManager
Defines a chained readiness checker implementation combining multiple checks.

Namespace

Drupal\automatic_updates\ReadinessChecker

Code

protected function getSortedCheckers() {
  $sorted = [];
  foreach ($this->checkers as $category => $priorities) {
    foreach ($priorities as $checkers) {
      krsort($checkers);
      $sorted[$category][] = $checkers;
    }
    $sorted[$category] = array_merge(...$sorted[$category]);
  }
  return $sorted;
}