You are here

public function Internal::requirements in Production check & Production monitor 8

Fetches all the requirements for the prod check status report page.

Return value

array An array of requirements keyed by plugin id.

File

src/Plugin/ProdCheckProcessor/Internal.php, line 23

Class

Internal
Internal processor that handles processing of all checks.

Namespace

Drupal\prod_check\Plugin\ProdCheckProcessor

Code

public function requirements() {
  $definitions = $this->checkManager
    ->getDefinitions();
  $requirements = [];
  foreach ($definitions as $plugin_id => $definition) {
    $plugin = $this->checkManager
      ->createInstance($plugin_id, $definition);
    $requirement = $this
      ->process($plugin);
    if (!empty($requirement)) {
      $requirements[$plugin_id] = $requirement;
    }
  }
  return $requirements;
}