Documentation

StabilityFlags
in package

Adapted from Composer's RootPackageLoader::extractStabilityFlags

Tags
author

Bryan Davis bd808@bd808.com

Table of Contents

$explicitStabilityRe  : string
$minimumStability  : int
$stabilityFlags  : array<string|int, mixed>
__construct()  : mixed
extractAll()  : array<string|int, mixed>
Extract and merge stability flags from the given collection of requires with another collection of stability flags.
getCurrentStability()  : int|null
Get the current stability of a given package.
getExplicitStability()  : int|null
Extract the most unstable explicit stability (eg '@dev') from a version specification.
getParsedStability()  : int|null
Get the stability of a version
getStabilityInt()  : int
Get the stability value for a given string.
splitConstraints()  : array<string|int, mixed>
Split a version specification into a list of version constraints.

Properties

$explicitStabilityRe

protected string $explicitStabilityRe

Regex to extract an explict stability flag (eg '@dev')

$minimumStability

protected int $minimumStability

Current default minimum stability

$stabilityFlags

protected array<string|int, mixed> $stabilityFlags

Current package name => stability mappings

Methods

__construct()

public __construct([array<string|int, mixed> $stabilityFlags = array() ][, int $minimumStability = BasePackage::STABILITY_STABLE ]) : mixed
Parameters
$stabilityFlags : array<string|int, mixed> = array()

Current package name => stability mappings

$minimumStability : int = BasePackage::STABILITY_STABLE

Current default minimum stability

Return values
mixed

extractAll()

Extract and merge stability flags from the given collection of requires with another collection of stability flags.

public extractAll(array<string|int, mixed> $requires) : array<string|int, mixed>
Parameters
$requires : array<string|int, mixed>

New package name => link mappings

Return values
array<string|int, mixed>

Unified package name => stability mappings

getCurrentStability()

Get the current stability of a given package.

protected getCurrentStability(string $name) : int|null
Parameters
$name : string
Return values
int|null

Stability of null if not set

getExplicitStability()

Extract the most unstable explicit stability (eg '@dev') from a version specification.

protected getExplicitStability(string $version) : int|null
Parameters
$version : string
Return values
int|null

Stability or null if no explict stability found

getParsedStability()

Get the stability of a version

protected getParsedStability(string $version) : int|null
Parameters
$version : string
Return values
int|null

Stability or null if STABLE or less than minimum

getStabilityInt()

Get the stability value for a given string.

protected getStabilityInt(string $name) : int
Parameters
$name : string

Stability name

Return values
int

Stability value

splitConstraints()

Split a version specification into a list of version constraints.

protected splitConstraints(string $version) : array<string|int, mixed>
Parameters
$version : string
Return values
array<string|int, mixed>

Search results