final class ExtensionVersion (View source)

internal  
 

Provides an extension version value object.

Constants

CORE_PREFIX

The '8.x-' prefix is used on contrib extension version numbers.

Properties

protected string $majorVersion

The major version.

protected string|null $minorVersion

The minor version.

protected string|null $versionExtra

The version extra string.

Methods

createFromVersionString(string $version_string)

Constructs an extension version object from a version string.

createFromSupportBranch(string $branch)

Constructs an ExtensionVersion version object from a support branch.

string
getMajorVersion()

Gets the major version.

string|null
getMinorVersion()

Gets the minor version.

string|null
getVersionExtra()

Gets the version extra string at the end of the version number.

Details

static ExtensionVersion createFromVersionString(string $version_string)

Constructs an extension version object from a version string.

Parameters

string $version_string

The version string.

Return Value

ExtensionVersion

The extension version instance.

static ExtensionVersion createFromSupportBranch(string $branch)

Constructs an ExtensionVersion version object from a support branch.

This can be used to determine the major version of the branch. ::getVersionExtra() will always return NULL for branches.

Parameters

string $branch

The support branch.

Return Value

ExtensionVersion

The ExtensionVersion instance.

string getMajorVersion()

Gets the major version.

Return Value

string

The major version.

string|null getMinorVersion()

Gets the minor version.

Return Value

string|null

The minor version.

string|null getVersionExtra()

Gets the version extra string at the end of the version number.

Return Value

string|null

The version extra string if available, or otherwise NULL.