PHP Class Naneau\SemVer\Version

A single SemVer version
Inheritance: extends Naneau\SemVer\Version\Versionable
Datei anzeigen Open project: naneau/semver Class Usage Examples

Public Methods

Method Description
__toString ( ) : string String representation of this Version
cleanCopy ( ) : Version Create a new Version that discards the entity information of build and originalVersionString
getBuild ( ) : Naneau\SemVer\Version\Build Get the build
getOriginalVersion ( ) : string Get the original version string
getPreRelease ( ) : Naneau\SemVer\Version\PreRelease Get the pre release version
hasBuild ( ) : boolean Does this Version have a Build?
hasPreRelease ( ) : boolean Does this Version have a pre release?
next ( Version | string | null $base = null ) : Version Get the next logical version relative to the provided base version. If no base is supplied, base will be the same as the current version.
setBuild ( Naneau\SemVer\Version\Build $build ) : Version Set the build
setOriginalVersion ( $version ) Set the original version string for later usage
setPreRelease ( Naneau\SemVer\Version\PreRelease $preRelease ) : Version Set the pre release version

Method Details

__toString() public method

String representation of this Version
public __toString ( ) : string
return string

cleanCopy() public method

Create a new Version that discards the entity information of build and originalVersionString
public cleanCopy ( ) : Version
return Version

getBuild() public method

Get the build
public getBuild ( ) : Naneau\SemVer\Version\Build
return Naneau\SemVer\Version\Build

getOriginalVersion() public method

Get the original version string
public getOriginalVersion ( ) : string
return string

getPreRelease() public method

Get the pre release version
public getPreRelease ( ) : Naneau\SemVer\Version\PreRelease
return Naneau\SemVer\Version\PreRelease

hasBuild() public method

Does this Version have a Build?
public hasBuild ( ) : boolean
return boolean

hasPreRelease() public method

Does this Version have a pre release?
public hasPreRelease ( ) : boolean
return boolean

next() public method

Get the next logical version relative to the provided base version. If no base is supplied, base will be the same as the current version.
public next ( Version | string | null $base = null ) : Version
$base Version | string | null
return Version

setBuild() public method

Set the build
public setBuild ( Naneau\SemVer\Version\Build $build ) : Version
$build Naneau\SemVer\Version\Build
return Version

setOriginalVersion() public method

Set the original version string for later usage
public setOriginalVersion ( $version )
$version

setPreRelease() public method

Set the pre release version
public setPreRelease ( Naneau\SemVer\Version\PreRelease $preRelease ) : Version
$preRelease Naneau\SemVer\Version\PreRelease
return Version