function Constraint::extractBounds
Return value
void
2 calls to Constraint::extractBounds()
- Constraint::getLowerBound in vendor/
composer/ semver/ src/ Constraint/ Constraint.php - Constraint::getUpperBound in vendor/
composer/ semver/ src/ Constraint/ Constraint.php
File
-
vendor/
composer/ semver/ src/ Constraint/ Constraint.php, line 394
Class
- Constraint
- Defines a constraint.
Namespace
Composer\Semver\ConstraintCode
private function extractBounds() {
if (null !== $this->lowerBound) {
return;
}
// Branches
if (strpos($this->version, 'dev-') === 0) {
$this->lowerBound = Bound::zero();
$this->upperBound = Bound::positiveInfinity();
return;
}
switch ($this->operator) {
case self::OP_EQ:
$this->lowerBound = new Bound($this->version, true);
$this->upperBound = new Bound($this->version, true);
break;
case self::OP_LT:
$this->lowerBound = Bound::zero();
$this->upperBound = new Bound($this->version, false);
break;
case self::OP_LE:
$this->lowerBound = Bound::zero();
$this->upperBound = new Bound($this->version, true);
break;
case self::OP_GT:
$this->lowerBound = new Bound($this->version, false);
$this->upperBound = Bound::positiveInfinity();
break;
case self::OP_GE:
$this->lowerBound = new Bound($this->version, true);
$this->upperBound = Bound::positiveInfinity();
break;
case self::OP_NE:
$this->lowerBound = Bound::zero();
$this->upperBound = Bound::positiveInfinity();
break;
}
}