You are here

public static function ProjectSecurityData::createFromProjectDataAndReleases in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/src/ProjectSecurityData.php \Drupal\update\ProjectSecurityData::createFromProjectDataAndReleases()

Creates a ProjectSecurityData object from project data and releases.

Parameters

array $project_data: Project data from Drupal\update\UpdateManagerInterface::getProjects() and processed by update_process_project_info().

array $releases: Project releases as returned by update_get_available().

Return value

static

File

core/modules/update/src/ProjectSecurityData.php, line 91

Class

ProjectSecurityData
Calculates a project's security coverage information.

Namespace

Drupal\update

Code

public static function createFromProjectDataAndReleases(array $project_data, array $releases) {
  if (!($project_data['project_type'] === 'core' && $project_data['name'] === 'drupal')) {

    // Only Drupal core has an explicit coverage range.
    return new static();
  }
  return new static($project_data['existing_version'], $releases);
}