stats(); $elements = []; foreach ($fixity->summary($stats) as $summary) { $elements[] = [ '#markup' => $summary, '#suffix' => '
', ]; } $failed = $stats['failed'] > 0; $out_to_date = $stats['periodic']['expired'] > 0; $requirements['dgi_fixity'] = [ 'title' => new TranslatableMarkup('Fixity'), 'value' => $failed ? new TranslatableMarkup('Error') : ($out_to_date ? new TranslatableMarkup('Out of date') : new TranslatableMarkup('Up to date')), 'description' => \Drupal::service('renderer')->render($elements), 'severity' => $failed ? REQUIREMENT_ERROR : ($out_to_date ? REQUIREMENT_WARNING : REQUIREMENT_OK), ]; } return $requirements; }