public function CoreVersionRequirement::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/ CoreVersionRequirement.php, line 22
Class
- CoreVersionRequirement
- Defines a core version requirement.
Namespace
Drupal\acquia_contenthub_diagnostic\Plugin\ContentHubRequirementCode
public function verify() {
if (version_compare(\Drupal::VERSION, self::MINIMUM_SUPPORTED_VERSION, '>=')) {
return REQUIREMENT_OK;
}
$this
->setValue($this
->t('Unsupported version (@version)', [
'@version' => \Drupal::VERSION,
]));
$this
->setDescription($this
->t('Drupal @version or greater is required.', [
'@version' => self::MINIMUM_SUPPORTED_VERSION,
]));
return REQUIREMENT_ERROR;
}