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

Breadcrumb

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

class PartialSecurityAdvisory

Hierarchy

  • class \Composer\Advisory\PartialSecurityAdvisory implements \JsonSerializable

Expanded class hierarchy of PartialSecurityAdvisory

3 files declare their use of PartialSecurityAdvisory
AdvisoryProviderInterface.php in vendor/composer/composer/src/Composer/Repository/AdvisoryProviderInterface.php
ComposerRepository.php in vendor/composer/composer/src/Composer/Repository/ComposerRepository.php
RepositorySet.php in vendor/composer/composer/src/Composer/Repository/RepositorySet.php

File

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

Namespace

Composer\Advisory
View source
class PartialSecurityAdvisory implements JsonSerializable {
    
    /**
     * @var string
     * @readonly
     */
    public $advisoryId;
    
    /**
     * @var string
     * @readonly
     */
    public $packageName;
    
    /**
     * @var ConstraintInterface
     * @readonly
     */
    public $affectedVersions;
    
    /**
     * @param array<mixed> $data
     * @return SecurityAdvisory|PartialSecurityAdvisory
     */
    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);
    }
    public function __construct(string $packageName, string $advisoryId, ConstraintInterface $affectedVersions) {
        $this->advisoryId = $advisoryId;
        $this->packageName = $packageName;
        $this->affectedVersions = $affectedVersions;
    }
    
    /**
     * @return mixed
     */
    public function jsonSerialize() {
        $data = (array) $this;
        $data['affectedVersions'] = $data['affectedVersions']->getPrettyString();
        return $data;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PartialSecurityAdvisory::$advisoryId public property @readonly
PartialSecurityAdvisory::$affectedVersions public property @readonly
PartialSecurityAdvisory::$packageName public property @readonly
PartialSecurityAdvisory::create public static function
PartialSecurityAdvisory::jsonSerialize public function 1
PartialSecurityAdvisory::__construct public function 1

API Navigation

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