function MultiConstraint::extractBounds
Return value
void
2 calls to MultiConstraint::extractBounds()
- MultiConstraint::getLowerBound in vendor/
composer/ semver/ src/ Constraint/ MultiConstraint.php - MultiConstraint::getUpperBound in vendor/
composer/ semver/ src/ Constraint/ MultiConstraint.php
File
-
vendor/
composer/ semver/ src/ Constraint/ MultiConstraint.php, line 303
Class
- MultiConstraint
- Defines a conjunctive or disjunctive set of constraints.
Namespace
Composer\Semver\ConstraintCode
private function extractBounds() {
if (null !== $this->lowerBound) {
return;
}
foreach ($this->constraints as $constraint) {
if (null === $this->lowerBound || null === $this->upperBound) {
$this->lowerBound = $constraint->getLowerBound();
$this->upperBound = $constraint->getUpperBound();
continue;
}
if ($constraint->getLowerBound()
->compareTo($this->lowerBound, $this->isConjunctive() ? '>' : '<')) {
$this->lowerBound = $constraint->getLowerBound();
}
if ($constraint->getUpperBound()
->compareTo($this->upperBound, $this->isConjunctive() ? '<' : '>')) {
$this->upperBound = $constraint->getUpperBound();
}
}
}