function ProjectSecurityData::createFromProjectDataAndReleases

Same name in other branches
  1. 9 core/modules/update/src/ProjectSecurityData.php \Drupal\update\ProjectSecurityData::createFromProjectDataAndReleases()
  2. 8.9.x core/modules/update/src/ProjectSecurityData.php \Drupal\update\ProjectSecurityData::createFromProjectDataAndReleases()
  3. 10 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 94

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);
}

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