Download the PHP package brunorb/semverphp without Composer
On this page you can find all versions of the php package brunorb/semverphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download brunorb/semverphp
More information about brunorb/semverphp
Files in brunorb/semverphp
Download brunorb/semverphp
More information about brunorb/semverphp
Files in brunorb/semverphp
Vendor brunorb
Package semverphp
Short Description Semantic Versioning 2.0.0 utility library
License MIT
Homepage https://github.com/BrunoRB/semverphp
Package semverphp
Short Description Semantic Versioning 2.0.0 utility library
License MIT
Homepage https://github.com/BrunoRB/semverphp
Keywords semversemantic versioning
Please rate this library. Is it a good library?
Informations about the package semverphp
SemverPHP
Semantic Versioning 2.0.0 utility library:
- Comparison
- Validation
- Split
Installing / Running
composer require brunorb/semverphp
use BrunoRB\SemverPHP;
API
isValid(semver) -> bool
$v1 = '1.2.0-alpha+001';
$v2 = '1.2.1';
SemverPHP::isValid($v1); // true
SemverPHP::isValid($v2); // true
SemverPHP::isValid('1.1'); // false
split(semver) -> array
$v1 = '1.2.0-alpha+001';
$v2 = '1.2.1+001';
SemverPHP::split($v1); // [major: '1', minor: '2', patch: '0', preRelease: 'alpha', 'buildMetadata': '001']
SemverPHP::split($v2); // [major: '1', minor: '2', patch: '1', preRelease: null, buildMetadata: '001']
compare(semver1, semver2) -> int
$v1 = '1.2.0-alpha+001';
$v2 = '1.2.1';
SemverPHP::compare($v1, $v2); // -1
SemverPHP::compare($v2, $v1); // 1
SemverPHP::compare($v1, $v1); // 0
PATTERN -> string
preg_match(SemverPHP::PATTERN, 'semver');
preg_replace(SemverPHP::PATTERN, 'semver');
... other regex methods
Tests
tests/BasicTest.php
composer run-script test
License
The MIT License
All versions of semverphp with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
The package brunorb/semverphp contains the following files
Loading the files please wait ...