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
Namespace
PharIo\VersionCode
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);
}