Helper class generating intervals from constraints
This contains utilities for:
-
compacting an existing constraint which can be used to combine several into one by creating a MultiConstraint out of the many constraints you have.
-
checking whether one subset is a subset of another.
Note: You should call clear to free memoization memory usage when you are done using this class
Methods |
public static clear() Clears the memoization cache once you are done
|
public static compactConstraint(Composer Attempts to optimize a MultiConstraint When merging MultiConstraints together they can get very large, this will compact it by looking at the real intervals covered by all the constraints and then creates a new constraint containing only the smallest amount of rules to match the same intervals.
|
public static get(Composer Creates an array of numeric intervals and branch constraints representing a given constraint if the returned numeric array is empty it means the constraint matches nothing in the numeric range (0 - +inf) if the returned branches array is empty it means no dev-* versions are matched if a constraint matches all possible dev-* versions, branches will contain Interval::anyDev()
|
public static haveIntersections(Composer Checks whether $a and $b have any intersection, equivalent to $a->matches($b)
|
public static isSubsetOf(Composer Checks whether $candidate is a subset of $constraint
|
Properties |
private static $intervalsCache = []
|
private static $opSortOrder = ['>=' => -3, '<' => -2, '>' => 2, '<=' => 3]
|
Methods |
private static generateIntervals(Composer
|
private static generateSingleConstraintIntervals(Composer
|
Properties |
private static $intervalsCache = []
|
private static $opSortOrder = ['>=' => -3, '<' => -2, '>' => 2, '<=' => 3]
|
Methods |
public static clear() Clears the memoization cache once you are done
|
public static compactConstraint(Composer Attempts to optimize a MultiConstraint When merging MultiConstraints together they can get very large, this will compact it by looking at the real intervals covered by all the constraints and then creates a new constraint containing only the smallest amount of rules to match the same intervals.
|
private static generateIntervals(Composer
|
private static generateSingleConstraintIntervals(Composer
|
public static get(Composer Creates an array of numeric intervals and branch constraints representing a given constraint if the returned numeric array is empty it means the constraint matches nothing in the numeric range (0 - +inf) if the returned branches array is empty it means no dev-* versions are matched if a constraint matches all possible dev-* versions, branches will contain Interval::anyDev()
|
public static haveIntersections(Composer Checks whether $a and $b have any intersection, equivalent to $a->matches($b)
|
public static isSubsetOf(Composer Checks whether $candidate is a subset of $constraint
|