Sha256: 8442152e226d19057326d9f6ef3cf7388922aa4b56ed082bdb24fab23025d6f3

Contents?: true

Size: 1.58 KB

Versions: 42

Compression:

Stored size: 1.58 KB

Contents

composer/semver
===============

Semver library that offers utilities, version constraint parsing and validation.

Originally written as part of [composer/composer](https://github.com/composer/composer),
now extracted and made available as a stand-alone library.

[![Build Status](https://travis-ci.org/composer/semver.svg?branch=master)](https://travis-ci.org/composer/semver)


Installation
------------

Install the latest version with:

```bash
$ composer require composer/semver
```


Requirements
------------

* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.


Version Comparison
------------------

For details on how versions are compared, refer to the [Versions](https://getcomposer.org/doc/articles/versions.md)
article in the documentation section of the [getcomposer.org](https://getcomposer.org) website.


Basic usage
-----------

### Comparator

The `Composer\Semver\Comparator` class provides the following methods for comparing versions:

* greaterThan($v1, $v2)
* greaterThanOrEqualTo($v1, $v2)
* lessThan($v1, $v2)
* lessThanOrEqualTo($v1, $v2)
* equalTo($v1, $v2)
* notEqualTo($v1, $v2)

Each function takes two version strings as arguments. For example:

```php
use Composer\Semver\Comparator;

Comparator::greaterThan('1.25.0', '1.24.0'); // 1.25.0 > 1.24.0
```

### Semver

The `Composer\Semver\Semver` class provides the following methods:

* satisfies($version, $constraints)
* satisfiedBy(array $versions, $constraint)
* sort($versions)
* rsort($versions)


License
-------

composer/semver is licensed under the MIT License, see the LICENSE file for details.

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
dependabot-composer-0.119.0.beta1 helpers/vendor/composer/semver/README.md
dependabot-composer-0.113.19 helpers/vendor/composer/semver/README.md
dependabot-composer-0.112.1 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.57 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.56 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.52 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.50 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.25 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.17 helpers/vendor/composer/semver/README.md
dependabot-composer-0.111.15 helpers/vendor/composer/semver/README.md
dependabot-composer-0.110.13 helpers/vendor/composer/semver/README.md
dependabot-composer-0.108.11 helpers/vendor/composer/semver/README.md
dependabot-composer-0.108.8 helpers/vendor/composer/semver/README.md
dependabot-composer-0.107.47 helpers/vendor/composer/semver/README.md
dependabot-composer-0.107.39 helpers/vendor/composer/semver/README.md
dependabot-composer-0.107.36 helpers/vendor/composer/semver/README.md
dependabot-composer-0.107.28 helpers/vendor/composer/semver/README.md
dependabot-composer-0.107.14 helpers/vendor/composer/semver/README.md
dependabot-composer-0.106.12 helpers/vendor/composer/semver/README.md
dependabot-composer-0.106.11 helpers/vendor/composer/semver/README.md