\Composer\Semver\ConstraintConstraint

Defines a constraint.

Summary

Methods
Properties
Constants
matches()
setPrettyString()
getPrettyString()
getSupportedOperators()
__construct()
versionCompare()
matchSpecific()
__toString()
No public properties found
OP_EQ
OP_LT
OP_LE
OP_GT
OP_GE
OP_NE
No protected methods found
$operator
$version
$prettyString
N/A
No private methods found
$transOpStr
$transOpInt
N/A

Constants

OP_EQ

OP_EQ = 0

OP_LT

OP_LT = 1

OP_LE

OP_LE = 2

OP_GT

OP_GT = 3

OP_GE

OP_GE = 4

OP_NE

OP_NE = 5

Properties

$operator

$operator : string

Type

string

$version

$version : string

Type

string

$prettyString

$prettyString : string

Type

string

$transOpStr

$transOpStr : array

Operator to integer translation table.

Type

array

$transOpInt

$transOpInt : array

Integer to operator translation table.

Type

array

Methods

setPrettyString()

setPrettyString(string  $prettyString) 

Parameters

string $prettyString

getPrettyString()

getPrettyString() : string

Returns

string

getSupportedOperators()

getSupportedOperators() : array

Get all supported comparison operators.

Returns

array

__construct()

__construct(string  $operator, string  $version) 

Sets operator and version to compare with.

Parameters

string $operator
string $version

Throws

\InvalidArgumentException

if invalid operator is given.

versionCompare()

versionCompare(string  $a, string  $b, string  $operator, boolean  $compareBranches = false) : boolean

Parameters

string $a
string $b
string $operator
boolean $compareBranches

Throws

\InvalidArgumentException

if invalid operator is given.

Returns

boolean

matchSpecific()

matchSpecific(\Composer\Semver\Constraint\Constraint  $provider, boolean  $compareBranches = false) : boolean

Parameters

\Composer\Semver\Constraint\Constraint $provider
boolean $compareBranches

Returns

boolean

__toString()

__toString() : string

Returns

string