You are here

public function AbstractConstraint::matches in Zircon Profile 8

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

Parameters

ConstraintInterface $provider:

Return value

bool

Overrides ConstraintInterface::matches

File

vendor/composer/semver/src/Constraint/AbstractConstraint.php, line 27

Class

AbstractConstraint
Base constraint class.

Namespace

Composer\Semver\Constraint

Code

public function matches(ConstraintInterface $provider) {
  if ($provider instanceof MultiConstraint) {

    // turn matching around to find a match
    return $provider
      ->matches($this);
  }
  if ($provider instanceof $this) {

    // see note at bottom of this class declaration
    return $this
      ->matchSpecific($provider);
  }
  return true;
}