protected function ProjectCoreCompatibility::getPossibleCoreUpdateVersions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/update/src/ProjectCoreCompatibility.php \Drupal\update\ProjectCoreCompatibility::getPossibleCoreUpdateVersions()
- 9 core/modules/update/src/ProjectCoreCompatibility.php \Drupal\update\ProjectCoreCompatibility::getPossibleCoreUpdateVersions()
Gets the core versions that should be considered for compatibility ranges.
Parameters
array $core_releases: The Drupal core available releases.
Return value
string[] The core version numbers that are possible to update the site to.
File
- core/
modules/ update/ src/ ProjectCoreCompatibility.php, line 78
Class
- ProjectCoreCompatibility
- Utility class to set core compatibility messages for project releases.
Namespace
Drupal\updateCode
protected function getPossibleCoreUpdateVersions(array $core_releases) {
if (!isset($core_releases[$this->existingCoreVersion])) {
// If we can't determine the existing version of core then we can't
// calculate the core compatibility of a given release based on core
// versions after the existing version.
return [];
}
$core_release_versions = array_keys($core_releases);
$possible_core_update_versions = Semver::satisfiedBy($core_release_versions, '>= ' . $this->existingCoreVersion);
$possible_core_update_versions = Semver::sort($possible_core_update_versions);
$possible_core_update_versions = array_filter($possible_core_update_versions, function ($version) {
return VersionParser::parseStability($version) === 'stable';
});
return $possible_core_update_versions;
}