PHP Class Airship\Engine\Continuum\Version

This contains the version comparison logic.
Afficher le fichier Open project: paragonie/airship Class Usage Examples

Protected Properties

Свойство Type Description
$currentVersion string

Méthodes publiques

Méthode Description
__construct ( string $currentVersion ) Version constructor.
getGroup ( integer $value, integer $group = self::GROUP_INCREMENT ) : integer Get the value within a group (i.e. 1.0.3 => 1000300)
getUpgrade ( integer $type = self::GROUP_PATCH ) : string Get the expected next version, based on upgrade type.
isMajorUpgrade ( string $nextVersion ) : boolean Is this a major upgrade? (Semantic versioning)
isMinorUpgrade ( string $nextVersion ) : boolean Is this a minor upgrade? (Semantic versioning)
isPatchUpgrade ( string $nextVersion ) : boolean Is this a patch upgrade? (Semantic versioning)
isUpgrade ( string $nextVersion ) : boolean Is $nextVersion newer than $this->currentVersion?

Method Details

__construct() public méthode

Version constructor.
public __construct ( string $currentVersion )
$currentVersion string

getGroup() public static méthode

Get the value within a group (i.e. 1.0.3 => 1000300)
public static getGroup ( integer $value, integer $group = self::GROUP_INCREMENT ) : integer
$value integer An expanded version
$group integer
Résultat integer

getUpgrade() public méthode

From '1.4.11': (self::GROUP_PATCH) -> '1.4.12' (self::GROUP_MINOR) -> '1.5.0' (self::GROUP_MAJOR) -> '2.0.0'
public getUpgrade ( integer $type = self::GROUP_PATCH ) : string
$type integer
Résultat string

isMajorUpgrade() public méthode

Is this a major upgrade? (Semantic versioning)
public isMajorUpgrade ( string $nextVersion ) : boolean
$nextVersion string
Résultat boolean

isMinorUpgrade() public méthode

Is this a minor upgrade? (Semantic versioning)
public isMinorUpgrade ( string $nextVersion ) : boolean
$nextVersion string
Résultat boolean

isPatchUpgrade() public méthode

Is this a patch upgrade? (Semantic versioning)
public isPatchUpgrade ( string $nextVersion ) : boolean
$nextVersion string
Résultat boolean

isUpgrade() public méthode

Is $nextVersion newer than $this->currentVersion?
public isUpgrade ( string $nextVersion ) : boolean
$nextVersion string
Résultat boolean

Property Details

$currentVersion protected_oe property

protected string $currentVersion
Résultat string