You are here

public function CoreVersionRequirement::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/CoreVersionRequirement.php, line 22

Class

CoreVersionRequirement
Defines a core version requirement.

Namespace

Drupal\acquia_contenthub_diagnostic\Plugin\ContentHubRequirement

Code

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;
}