Skip to content

seworqs/semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEworqs SemVer

A type-safe, chainable semantic versioning implementation for PHP with support for bumping versions, handling pre-releases, and comparing versions.

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 Class
Seworqs\Semver Semver

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

About

A type-safe, chainable semantic versioning implementation for PHP with support for bumping versions, handling pre-releases, and comparing versions.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages