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

Breadcrumb

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

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

Code

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

API Navigation

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