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

Breadcrumb

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

function VersionConstraintParser::handleTildeOperator

1 call to VersionConstraintParser::handleTildeOperator()
VersionConstraintParser::parse in vendor/phar-io/version/src/VersionConstraintParser.php

File

vendor/phar-io/version/src/VersionConstraintParser.php, line 68

Class

VersionConstraintParser

Namespace

PharIo\Version

Code

private function handleTildeOperator(string $value) : AndVersionConstraintGroup {
    $constraintValue = new VersionConstraintValue(\substr($value, 1));
    if ($constraintValue->getPatch()
        ->isAny()) {
        return $this->handleCaretOperator($value);
    }
    $constraints = [
        new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))),
        new SpecificMajorAndMinorVersionConstraint($value, $constraintValue->getMajor()
            ->getValue() ?? 0, $constraintValue->getMinor()
            ->getValue() ?? 0),
    ];
    return new AndVersionConstraintGroup($value, $constraints);
}

API Navigation

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