Version

Embed version informations.

package

Default

Methods

__construct

__construct(array<mixed,integer> $version, array<mixed,string> $stabilityVersion = array(),  $buildMetadata = '') 

Arguments

$version

array<mixed,integer>

list of numbers of the version (ex: [1,2,3] for 1.2.3)

$stabilityVersion

array<mixed,string>

list of stability informations that are informations following a '-' in a semantic version (ex: ['alpha', '2'] for 1.2.3-alpha.2)

$buildMetadata

__toString

__toString() 

getBranchVersion

getBranchVersion() 

getMajor

getMajor() 

getMinor

getMinor() 

Returns the next major version 2.1.3 -> 3.0.0 2.1b1.4 -> 3.0.0.

getNextMajorVersion() : string

Response

string

the next version

Returns the next minor version 2.1.3 -> 2.2 2.1 -> 2.2 2.1b1.4 -> 2.2.

getNextMinorVersion() : string

Response

string

the next version

Returns the next patch version 2.1.3 -> 2.1.4 2.1b1.4 -> 2.2.

getNextPatchVersion() : string

Response

string

the next version

returns the next version, by incrementing the last number, whatever it is.

getNextTailVersion() : string

If the version has a stability information (alpha, beta etc..), it returns only the version without stability version.

Response

string

the next version

getPatch

getPatch() 

getStabilityVersion

getStabilityVersion() 

getTailNumbers

getTailNumbers() 

getVersionArray

getVersionArray() 

hasMinor

hasMinor() 

hasPatch

hasPatch() 

toString

toString(boolean $withPatch = true) 

Arguments

$withPatch

boolean

true, it returns always x.y.z even if no patch or minor version was given

Properties

version

version : 

Type(s)

stabilityVersion

stabilityVersion : 

Type(s)