\QuickApps\Core\Package\Composer\Package\VersionVersionParser

Version parser

Summary

Methods
Properties
Constants
parseStability()
normalizeStability()
formatVersion()
normalize()
parseNumericAliasPrefix()
normalizeBranch()
parseLinks()
parseConstraints()
parseConstraint()
manipulateVersionString()
expandStability()
parseNameVersionPairs()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$modifierRegex
N/A

Properties

$modifierRegex

$modifierRegex : 

Type

Methods

parseStability()

parseStability(string $version) : string

Returns the stability of a version

Parameters

string $version

Version

Returns

string

normalizeStability()

normalizeStability(string $stability) : string

normalizeStability().

Parameters

string $stability

stability

Returns

string

formatVersion()

formatVersion(\QuickApps\Core\Package\Composer\Package\PackageInterface $package, boolean $truncate) : string

formatVersion().

Parameters

\QuickApps\Core\Package\Composer\Package\PackageInterface $package

Package

boolean $truncate

Whether to truncate or not

Returns

string

normalize()

normalize(string $version, string $fullVersion) : string

Normalizes a version string to be able to perform comparisons on it

Parameters

string $version

Version

string $fullVersion

optional complete version string to give more context

Throws

\UnexpectedValueException

Returns

string

parseNumericAliasPrefix()

parseNumericAliasPrefix(string $branch) : string|false

Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison

Parameters

string $branch

Branch name (e.g. 2.1.x-dev)

Returns

string|false —

Numeric prefix if present (e.g. 2.1.) or false

normalizeBranch()

normalizeBranch(string $name) : string

Normalizes a branch name to be able to perform comparisons on it

Parameters

string $name

Name

Returns

string

parseLinks()

parseLinks(string $source, string $sourceVersion, string $description, array $links) : array<mixed,\QuickApps\Core\Package\Composer\Package\Link>

Parameters

string $source

source package name

string $sourceVersion

source package version (pretty version ideally)

string $description

link description (e.g. requires, replaces, ..)

array $links

array of package name => constraint mappings

Returns

array<mixed,\QuickApps\Core\Package\Composer\Package\Link>

parseConstraints()

parseConstraints(string $constraints) : \Composer\Package\LinkConstraint\LinkConstraintInterface

Parses as constraint string into LinkConstraint objects

Parameters

string $constraints

Constraints

Returns

\Composer\Package\LinkConstraint\LinkConstraintInterface

parseConstraint()

parseConstraint(string $constraint) : array

parseConstraint().

Parameters

string $constraint

Constraint

Returns

array

manipulateVersionString()

manipulateVersionString(array $matches, integer $position, integer $increment, string $pad) : string

Increment, decrement, or simply pad a version number.

Support function for \parseConstraint()

Parameters

array $matches

Array with version parts in array indexes 1,2,3,4

integer $position

1,2,3,4 - which segment of the version to decrement

integer $increment

Increment

string $pad

The string to pad version parts after $position

Returns

string —

The new version

expandStability()

expandStability(string $stability) : string

expandStability().

Parameters

string $stability

Stability

Returns

string

parseNameVersionPairs()

parseNameVersionPairs(array $pairs) : array<mixed,array>

Parses a name/version pairs and returns an array of pairs + the

Parameters

array $pairs

a set of package/version pairs separated by ":", "=" or " "

Returns

array<mixed,array> —

array of arrays containing a name and (if provided) a version