seworqs/semver

Some useful functions when you use semantic versioning.

1.0.1 2025-04-03 19:50 UTC

This package is auto-updated.

Last update: 2025-04-03 19:55:38 UTC


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();

More examples

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

Badges

Latest Version Total Downloads License PHP Version Made by SEworqs