Constraint
    
            
            in package
            
        
    
            
            implements
                            ConstraintInterface                    
    
    
Defines a constraint.
Table of Contents
Interfaces
- ConstraintInterface
 - DO NOT IMPLEMENT this interface. It is only meant for usage as a type hint in libraries relying on composer/semver but creating your own constraint class that implements this interface is not a supported use case and will cause the composer/semver components to return unexpected results.
 
Constants
- OP_EQ = 0
 - OP_GE = 4
 - OP_GT = 3
 - OP_LE = 2
 - OP_LT = 1
 - OP_NE = 5
 - STR_OP_EQ = '=='
 - STR_OP_EQ_ALT = '='
 - STR_OP_GE = '>='
 - STR_OP_GT = '>'
 - STR_OP_LE = '<='
 - STR_OP_LT = '<'
 - STR_OP_NE = '!='
 - STR_OP_NE_ALT = '<>'
 
Properties
- $lowerBound : Bound
 - $operator : int
 - $prettyString : string|null
 - $upperBound : Bound
 - $version : string
 
Methods
- __construct() : mixed
 - Sets operator and version to compare with.
 - __toString() : string
 - compile() : string
 - Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression.
 - getLowerBound() : Bound
 - getOperator() : string
 - getOperatorConstant() : int
 - getPrettyString() : string
 - getSupportedOperators() : array<string|int, mixed>
 - Get all supported comparison operators.
 - getUpperBound() : Bound
 - getVersion() : string
 - matches() : bool
 - Checks whether the given constraint intersects in any way with this constraint
 - matchSpecific() : bool
 - setPrettyString() : void
 - versionCompare() : bool
 
Constants
OP_EQ
    public
        mixed
    OP_EQ
    = 0
    
    
    
    
OP_GE
    public
        mixed
    OP_GE
    = 4
    
    
    
    
OP_GT
    public
        mixed
    OP_GT
    = 3
    
    
    
    
OP_LE
    public
        mixed
    OP_LE
    = 2
    
    
    
    
OP_LT
    public
        mixed
    OP_LT
    = 1
    
    
    
    
OP_NE
    public
        mixed
    OP_NE
    = 5
    
    
    
    
STR_OP_EQ
    public
        mixed
    STR_OP_EQ
    = '=='
    
    
    
    
STR_OP_EQ_ALT
    public
        mixed
    STR_OP_EQ_ALT
    = '='
    
    
    
    
STR_OP_GE
    public
        mixed
    STR_OP_GE
    = '>='
    
    
    
    
STR_OP_GT
    public
        mixed
    STR_OP_GT
    = '>'
    
    
    
    
STR_OP_LE
    public
        mixed
    STR_OP_LE
    = '<='
    
    
    
    
STR_OP_LT
    public
        mixed
    STR_OP_LT
    = '<'
    
    
    
    
STR_OP_NE
    public
        mixed
    STR_OP_NE
    = '!='
    
    
    
    
STR_OP_NE_ALT
    public
        mixed
    STR_OP_NE_ALT
    = '<>'
    
    
    
    
Properties
$lowerBound
    protected
        Bound
    $lowerBound
    
    
    
    
    
$operator
    protected
        int
    $operator
    
    
    
    
    Tags
$prettyString
    protected
        string|null
    $prettyString
    
    
    
    
    
$upperBound
    protected
        Bound
    $upperBound
    
    
    
    
    
$version
    protected
        string
    $version
    
    
    
    
    
Methods
__construct()
Sets operator and version to compare with.
    public
                    __construct(string $operator, string $version) : mixed
    Parameters
- $operator : string
 - $version : string
 
Tags
__toString()
    public
                    __toString() : string
    Return values
stringcompile()
Provides a compiled version of the constraint for the given operator The compiled version must be a PHP expression.
    public
                    compile(mixed $otherOperator) : string
    Parameters
- $otherOperator : mixed
 - 
                    
one Constraint::OP_*
 
Return values
stringgetLowerBound()
    public
                    getLowerBound() : Bound
    Return values
BoundgetOperator()
    public
                    getOperator() : string
    Tags
Return values
stringgetOperatorConstant()
    public
            static        getOperatorConstant(string $operator) : int
    Parameters
- $operator : string
 
Tags
Return values
intgetPrettyString()
    public
                    getPrettyString() : string
    Return values
stringgetSupportedOperators()
Get all supported comparison operators.
    public
            static        getSupportedOperators() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed>getUpperBound()
    public
                    getUpperBound() : Bound
    Return values
BoundgetVersion()
    public
                    getVersion() : string
    Return values
stringmatches()
Checks whether the given constraint intersects in any way with this constraint
    public
                    matches(ConstraintInterface $provider) : bool
    Parameters
- $provider : ConstraintInterface
 
Return values
boolmatchSpecific()
    public
                    matchSpecific(Constraint $provider[, bool $compareBranches = false ]) : bool
    Parameters
- $provider : Constraint
 - $compareBranches : bool = false
 
Return values
boolsetPrettyString()
    public
                    setPrettyString(mixed $prettyString) : void
    Parameters
- $prettyString : mixed
 
versionCompare()
    public
                    versionCompare(string $a, string $b, string $operator[, bool $compareBranches = false ]) : bool
    Parameters
- $a : string
 - $b : string
 - $operator : string
 - $compareBranches : bool = false