Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PartialSecurityAdvisory.php

function PartialSecurityAdvisory::create

Parameters

array<mixed> $data:

Return value

SecurityAdvisory|PartialSecurityAdvisory

1 call to PartialSecurityAdvisory::create()
ComposerRepository::getSecurityAdvisories in vendor/composer/composer/src/Composer/Repository/ComposerRepository.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Advisory/PartialSecurityAdvisory.php, line 43

Class

PartialSecurityAdvisory

Namespace

Composer\Advisory

Code

public static function create(string $packageName, array $data, VersionParser $parser) : self {
    $constraint = $parser->parseConstraints($data['affectedVersions']);
    if (isset($data['title'], $data['sources'], $data['reportedAt'])) {
        return new SecurityAdvisory($packageName, $data['advisoryId'], $constraint, $data['title'], $data['sources'], new \DateTimeImmutable($data['reportedAt'], new \DateTimeZone('UTC')), $data['cve'] ?? null, $data['link'] ?? null, $data['severity'] ?? null);
    }
    return new self($packageName, $data['advisoryId'], $constraint);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal