final class SecurityAdvisory (View source)

internal  
 

Provides a security advisory value object.

These come from the security advisory feed on Drupal.org.

Properties

protected string $title

The title of the advisory.

protected string $project

The project name for the advisory.

protected string $type

The project type for the advisory.

protected bool $isPsa

Whether this advisory is a PSA instead of another type of advisory.

protected string[] $insecureVersions

The currently insecure versions of the project.

protected string $url

The URL to the advisory.

Methods

createFromArray(array $data)

Creates a SecurityAdvisories instance from an array.

static void
validateAdvisoryData(array $data)

Validates the security advisory data.

string
getTitle()

Gets the title.

string
getProject()

Gets the project associated with the advisory.

string
getProjectType()

Gets the type of project associated with the advisory.

bool
isCoreAdvisory()

Whether the security advisory is for core or not.

bool
isPsa()

Whether the security advisory is a public service announcement or not.

array
getInsecureVersions()

Gets the currently insecure versions of the project.

string
getUrl()

Gets the URL to the security advisory.

Details

static SecurityAdvisory createFromArray(array $data)

Creates a SecurityAdvisories instance from an array.

Parameters

array $data

The security advisory data as returned from the JSON feed.

Return Value

SecurityAdvisory

A new SecurityAdvisories object.

static protected void validateAdvisoryData(array $data)

Validates the security advisory data.

Parameters

array $data

The advisory data.

Return Value

void

Exceptions

UnexpectedValueException

string getTitle()

Gets the title.

Return Value

string

The project title.

string getProject()

Gets the project associated with the advisory.

Return Value

string

The project name.

string getProjectType()

Gets the type of project associated with the advisory.

Return Value

string

The project type.

bool isCoreAdvisory()

Whether the security advisory is for core or not.

Return Value

bool

TRUE if the advisory is for core, or FALSE otherwise.

bool isPsa()

Whether the security advisory is a public service announcement or not.

Return Value

bool

TRUE if the advisory is a public service announcement, or FALSE otherwise.

array getInsecureVersions()

Gets the currently insecure versions of the project.

Return Value

array

The versions of the project that are currently insecure.

string getUrl()

Gets the URL to the security advisory.

Return Value

string

The URL to the security advisory.