A library for creating, editing, and comparing semantic versioning numbers.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src
.gitignore
.travis.yml Added PHP 5.6 and HHVM to travis.yml Aug 9, 2014
LICENSE
README.md
composer.json bump up branch alias as it should not be the same version that was al… Jul 14, 2014
phpunit.xml.dist

README.md

Version

Build Status

Version is a library for creating, editing, and comparing semantic version numbers. Currently, v2.0.0 of the Semantic Versioning specification is supported.

use Herrera\Version\Dumper;
use Herrera\Version\Parser;

$builder = Parser::toBuilder('1.2.3-alpha+2');
$builder->incrementMajor();
$builder->clearBuild();
$builder->clearPreRelease();

echo Dumper::toString($builder); // echoes "2.0.0"

$finalVersion = $builder->getVersion();

Documentation