You are here

public function SupportedPhpVersion::run in Automatic Updates 8

Run check.

Return value

array An array of translatable strings.

Overrides ReadinessCheckerInterface::run

File

src/ReadinessChecker/SupportedPhpVersion.php, line 15

Class

SupportedPhpVersion
Supported PHP version checker.

Namespace

Drupal\automatic_updates\ReadinessChecker

Code

public function run() {
  $messages = [];
  $parser = new VersionParser();
  $unsupported_constraint = $this
    ->getUnsupportedVersionConstraint();
  if ($unsupported_constraint
    ->matches($parser
    ->parseConstraints($this
    ->getPhpVersion()))) {
    $messages[] = $this
      ->getMessage();
  }
  return $messages;
}