/** * Returns the highest valid version tag. * * @return Version */ public function getCurrentVersion() { $tags = $this->getValidVersionTags(); if (count($tags) === 0) { return Version::createInitialVersion(); } usort($tags, array("vierbergenlars\\SemVer\\version", "compare")); return new Version(array_pop($tags)); }
protected function initialize(InputInterface $input, OutputInterface $output) { $this->getContext()->setService('output', $this->output); $this->getContext()->getInformationCollector()->handleCommandInput($input); // Get the current version or generate a new one if the user has confirm that this is required try { $currentVersion = $this->getContext()->getVersionPersister()->getCurrentVersion(); } catch (\Liip\RMT\Exception\NoReleaseFoundException $e) { if ($this->getContext()->getInformationCollector()->getValueFor('confirm-first') == false) { throw $e; } $currentVersion = \Liip\RMT\Version::createInitialVersion(); } $this->getContext()->setParameter('current-version', $currentVersion); $this->writeBigTitle('New release (current is ' . $currentVersion . ')'); $this->executeActionListIfExist('prerequisites'); }
public function testCreateInitialVersion() { $version = Version::createInitialVersion(); $this->assertInstanceOf("Liip\\RMT\\Version", $version); }
/** * Returns 0.0.0 * * @return vierbergenlars\SemVer\version */ public function getInitialVersion() { return Version::createInitialVersion(); }