You are here

public function ModuleCompatibilityRequirement::verify in Acquia Content Hub 8

Verifies the requirement.

Return value

int The requirement status code:

Overrides ContentHubRequirementBase::verify

File

acquia_contenthub_diagnostic/src/Plugin/ContentHubRequirement/ModuleCompatibilityRequirement.php, line 24

Class

ModuleCompatibilityRequirement
Defines a module compatibility requirement.

Namespace

Drupal\acquia_contenthub_diagnostic\Plugin\ContentHubRequirement

Code

public function verify() {
  $active_modules = array_keys($this->moduleHandler
    ->getModuleList());
  $incompatibilities_found = array_intersect($active_modules, self::INCOMPATIBLE_MODULES);
  if (empty($incompatibilities_found)) {
    return REQUIREMENT_OK;
  }
  $this
    ->setValue($this
    ->t('Incompatibile modules active'));
  $this
    ->setDescription($this
    ->t('The following incompatible modules must be uninstalled: @module_list', [
    '@module_list' => implode(', ', $incompatibilities_found),
  ]));
  return REQUIREMENT_ERROR;
}