function Dependency::isCompatible

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Extension/Dependency.php \Drupal\Core\Extension\Dependency::isCompatible()
  2. 10 core/lib/Drupal/Core/Extension/Dependency.php \Drupal\Core\Extension\Dependency::isCompatible()
  3. 11.x core/lib/Drupal/Core/Extension/Dependency.php \Drupal\Core\Extension\Dependency::isCompatible()

Determines if the provided version is compatible with this dependency.

Parameters

string $version: The version to check, for example '4.2'.

Return value

bool TRUE if compatible with the provided version, FALSE if not.

File

core/lib/Drupal/Core/Extension/Dependency.php, line 108

Class

Dependency
A value object representing dependency information.

Namespace

Drupal\Core\Extension

Code

public function isCompatible($version) {
    return $this->getConstraint()
        ->isCompatible($version);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.