seworqs / semver
Some useful functions when you use semantic versioning.
1.0.1
2025-04-03 19:50 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^11
README
Some useful functions when you use semantic versioning.
Installation
Install via Composer.
$> composer require seworqs/semver
Usage
use Seworqs\Semver; use Seworqs\Semver\Enum\EnumBumpReleaseType; use Seworqs\Semver\Enum\EnumBumpPreReleaseType; // Create a semver from a string. $semver = Semver::fromString('2.5.3'); // Bumping will give you a new Semver! $newSemver = $semver->bump(EnumBumpReleaseType::PATCH); // $version = '2.5.4' $version = $newSemver->getCurrentVersion();
Features
- Bump to a release version
- Bump to a pre-release version
- Bump to a release version and start with a pre-release
- Compare versions
See our examples
Classes and namespaces
Namespace | Description |
---|---|
Seworqs\Semver | Nice helpers for working with Semantic Versioning |
License
Apache-2.0, see LICENSE
About SEworqs
Seworqs builds clean, reusable modules for PHP and Mendix developers.
Learn more at github.com/seworqs