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

Breadcrumb

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

function VersionConstraintParser::handleCaretOperator

2 calls to VersionConstraintParser::handleCaretOperator()
VersionConstraintParser::handleTildeOperator in vendor/phar-io/version/src/VersionConstraintParser.php
VersionConstraintParser::parse in vendor/phar-io/version/src/VersionConstraintParser.php

File

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

Class

VersionConstraintParser

Namespace

PharIo\Version

Code

private function handleCaretOperator(string $value) : AndVersionConstraintGroup {
    $constraintValue = new VersionConstraintValue(\substr($value, 1));
    $constraints = [
        new GreaterThanOrEqualToVersionConstraint($value, new Version(\substr($value, 1))),
    ];
    if ($constraintValue->getMajor()
        ->getValue() === 0) {
        $constraints[] = new SpecificMajorAndMinorVersionConstraint($value, $constraintValue->getMajor()
            ->getValue() ?? 0, $constraintValue->getMinor()
            ->getValue() ?? 0);
    }
    else {
        $constraints[] = new SpecificMajorVersionConstraint($value, $constraintValue->getMajor()
            ->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