You are here

public function MultiConstraint::matches in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/composer/semver/src/Constraint/MultiConstraint.php \Composer\Semver\Constraint\MultiConstraint::matches()

Parameters

ConstraintInterface $provider:

Return value

bool

Overrides ConstraintInterface::matches

File

vendor/composer/semver/src/Constraint/MultiConstraint.php, line 43

Class

MultiConstraint
Defines a conjunctive or disjunctive set of constraints.

Namespace

Composer\Semver\Constraint

Code

public function matches(ConstraintInterface $provider) {
  if (false === $this->conjunctive) {
    foreach ($this->constraints as $constraint) {
      if ($constraint
        ->matches($provider)) {
        return true;
      }
    }
    return false;
  }
  foreach ($this->constraints as $constraint) {
    if (!$constraint
      ->matches($provider)) {
      return false;
    }
  }
  return true;
}