function Intervals::haveIntersections
Checks whether $a and $b have any intersection, equivalent to $a->matches($b)
Return value
bool
1 call to Intervals::haveIntersections()
- UpdateCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ UpdateCommand.php - Executes the current command.
File
-
vendor/
composer/ semver/ src/ Intervals.php, line 114
Class
- Intervals
- Helper class generating intervals from constraints
Namespace
Composer\SemverCode
public static function haveIntersections(ConstraintInterface $a, ConstraintInterface $b) {
if ($a instanceof MatchAllConstraint || $b instanceof MatchAllConstraint) {
return true;
}
if ($a instanceof MatchNoneConstraint || $b instanceof MatchNoneConstraint) {
return false;
}
$intersectionIntervals = self::generateIntervals(new MultiConstraint(array(
$a,
$b,
), true), true);
return \count($intersectionIntervals['numeric']) > 0 || $intersectionIntervals['branches']['exclude'] || \count($intersectionIntervals['branches']['names']) > 0;
}