From aba201b4ba801c2c71b72389f1008c6fe11c399a Mon Sep 17 00:00:00 2001 From: Cinderella-Man Date: Thu, 23 Jan 2014 09:58:34 +0000 Subject: [PATCH] replaceVersion() method added --- src/Composer/Package/Package.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Composer/Package/Package.php b/src/Composer/Package/Package.php index b8a8252bc..f7ee0b1b7 100644 --- a/src/Composer/Package/Package.php +++ b/src/Composer/Package/Package.php @@ -493,4 +493,21 @@ class Package extends BasePackage { return $this->archiveExcludes; } + + /** + * Replaces current version and pretty version with passed values. + * It also sets stability. + * + * @param string $version + * + * @param string $prettyVersion + */ + public function replaceVersion($version, $prettyVersion) + { + $this->version = $version; + $this->prettyVersion = $prettyVersion; + + $this->stability = VersionParser::parseStability($version); + $this->dev = $this->stability === 'dev'; + } }