public function Constraint::isCompatible in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Version/Constraint.php \Drupal\Component\Version\Constraint::isCompatible()
Determines if the provided version is satisfied by this constraint.
Parameters
string $version: The version to check, for example '4.2'.
Return value
bool TRUE if the provided version is satisfied by this constraint, FALSE if not.
File
- core/
lib/ Drupal/ Component/ Version/ Constraint.php, line 64
Class
- Constraint
- A value object representing a Drupal version constraint.
Namespace
Drupal\Component\VersionCode
public function isCompatible($version) {
foreach ($this->constraintArray as $constraint) {
if (!version_compare($version, $constraint['version'], $constraint['op'])) {
return FALSE;
}
}
return TRUE;
}