public function ModuleCompatibilityRequirement::verify in Acquia Content Hub 8
Verifies the requirement.
Return value
int The requirement status code:
- REQUIREMENT_INFO: For info only.
- REQUIREMENT_OK: The requirement is satisfied.
- REQUIREMENT_WARNING: The requirement failed with a warning.
- REQUIREMENT_ERROR: The requirement failed with an error.
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\ContentHubRequirementCode
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;
}