phpextra/version

This package is abandoned and no longer maintained. No replacement package was suggested.

Version management class

1.0.0 2014-04-11 10:31 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:34:04 UTC


README

#Version library Build Status

This library is a wrapper for herrera-io/php-version.

Installation

Version can be installed via Composer:

{
    "require": {
        "phpextra/version": "~1.0"
    }
}

##Usage namespace PHPExtra\Version;

$version1 = Version::fromString('1.0.0');
$version2 = Version::fromString('1.0.0-rc1');
$version3 = Version::fromString('0.9.0-beta');

$version1->isEarlierThan($version2);

> true

$version1->isLaterThan($version3);

> true

$version1->isEqualTo($version1);

> true

$version1->compare($version1);

> 0
$version1->compare($version2);

> -1

$version1->compare($version3);

> 1

echo (string)$version1;
> 1.0.0

##Contributing

All code contributions must go through a pull request. Fork the project, create a feature branch, and send me a pull request. To ensure a consistent code base, you should make sure the code follows the coding standards. If you would like to help take a look at the list of issues.

##Requirements

See composer.json for a full list of dependencies.

##Authors

Jacek Kobus - kobus.jacek@gmail.com

License information

See the file LICENSE.txt for copying permission.