Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Intervals.php

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\Semver

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal