You are here

public static function Comparator::compare in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/composer/semver/src/Comparator.php \Composer\Semver\Comparator::compare()

Evaluates the expression: $version1 $operator $version2.

Parameters

string $version1:

string $operator:

string $version2:

Return value

bool

6 calls to Comparator::compare()
Comparator::equalTo in vendor/composer/semver/src/Comparator.php
Evaluates the expression: $version1 == $version2.
Comparator::greaterThan in vendor/composer/semver/src/Comparator.php
Evaluates the expression: $version1 > $version2.
Comparator::greaterThanOrEqualTo in vendor/composer/semver/src/Comparator.php
Evaluates the expression: $version1 >= $version2.
Comparator::lessThan in vendor/composer/semver/src/Comparator.php
Evaluates the expression: $version1 < $version2.
Comparator::lessThanOrEqualTo in vendor/composer/semver/src/Comparator.php
Evaluates the expression: $version1 <= $version2.

... See full list

File

vendor/composer/semver/src/Comparator.php, line 105

Class

Comparator

Namespace

Composer\Semver

Code

public static function compare($version1, $operator, $version2) {
  $constraint = new Constraint($operator, $version2);
  return $constraint
    ->matches(new Constraint('==', $version1));
}