t('@module_name (missing)', ['@module_name' => $dependency]);
}
else {
$module_name = $modules[$dependency]->info['name'];
// Check if the module is compatible with the installed version of core.
if ($modules[$dependency]->info['core_incompatible']) {
return $this->t('@module_name (incompatible with this version of Drupal core)', [
'@module_name' => $module_name,
]);
}
// Check if the module is incompatible with the dependency constraints.
// Remove CORE_COMPATIBILITY- only from the start of the string.
$version = preg_replace('/^(' . \Drupal::CORE_COMPATIBILITY . '\-)/', '', $modules[$dependency]->info['version'] ?? '');
if (!$dependency_object->isCompatible($version)) {
$constraint_string = $dependency_object->getConstraintString();
return $this->t('@module_name (incompatible with version @version)', [
'@module_name' => "$module_name ($constraint_string)",
'@version' => $modules[$dependency]->info['version'] ?? '* ? *',
]);
}
}
return NULL;
}
}