abstract class SupportedPhpVersion in Automatic Updates 8
Supported PHP version checker.
Hierarchy
- class \Drupal\automatic_updates\ReadinessChecker\SupportedPhpVersion implements ReadinessCheckerInterface
Expanded class hierarchy of SupportedPhpVersion
File
- src/
ReadinessChecker/ SupportedPhpVersion.php, line 10
Namespace
Drupal\automatic_updates\ReadinessCheckerView source
abstract class SupportedPhpVersion implements ReadinessCheckerInterface {
/**
* {@inheritdoc}
*/
public function run() {
$messages = [];
$parser = new VersionParser();
$unsupported_constraint = $this
->getUnsupportedVersionConstraint();
if ($unsupported_constraint
->matches($parser
->parseConstraints($this
->getPhpVersion()))) {
$messages[] = $this
->getMessage();
}
return $messages;
}
/**
* Get the PHP version.
*
* @return string
* The current php version.
*/
protected function getPhpVersion() {
return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
}
/**
* Get the unsupported PHP version constraint.
*
* @return \Composer\Semver\Constraint\ConstraintInterface
* The version constraint.
*/
protected abstract function getUnsupportedVersionConstraint();
/**
* Get the message to return if the current PHP version is unsupported.
*
* @return \Drupal\Component\Render\MarkupInterface
* The message to return if the current PHP version is unsupported.
*/
protected abstract function getMessage();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SupportedPhpVersion:: |
abstract protected | function | Get the message to return if the current PHP version is unsupported. | 2 |
SupportedPhpVersion:: |
protected | function | Get the PHP version. | 2 |
SupportedPhpVersion:: |
abstract protected | function | Get the unsupported PHP version constraint. | 2 |
SupportedPhpVersion:: |
public | function |
Run check. Overrides ReadinessCheckerInterface:: |