1
0
Fork 0

Merge pull request #2584 from Cinderella-Man/version-setter

Package version setter
pull/2728/merge
Jordi Boggiano 2014-02-20 15:16:32 +01:00
commit bbda0434e5
1 changed files with 16 additions and 0 deletions

View File

@ -493,4 +493,20 @@ class Package extends BasePackage
{
return $this->archiveExcludes;
}
/**
* Replaces current version and pretty version with passed values.
* It also sets stability.
*
* @param string $version The package's normalized version
* @param string $prettyVersion The package's non-normalized version
*/
public function replaceVersion($version, $prettyVersion)
{
$this->version = $version;
$this->prettyVersion = $prettyVersion;
$this->stability = VersionParser::parseStability($version);
$this->dev = $this->stability === 'dev';
}
}