function PreReleaseSuffix::parseValue
1 call to PreReleaseSuffix::parseValue()
- PreReleaseSuffix::__construct in vendor/
phar-io/ version/ src/ PreReleaseSuffix.php
File
-
vendor/
phar-io/ version/ src/ PreReleaseSuffix.php, line 66
Class
Namespace
PharIo\VersionCode
private function parseValue(string $value) : void {
$regex = '/-?((dev|beta|b|rc|alpha|a|patch|p|pl)\\.?(\\d*)).*$/i';
if (\preg_match($regex, $value, $matches) !== 1) {
throw new InvalidPreReleaseSuffixException(\sprintf('Invalid label %s', $value));
}
$this->full = $matches[1];
$this->value = $matches[2];
if ($matches[3] !== '') {
$this->number = (int) $matches[3];
}
$this->valueScore = $this->mapValueToScore($matches[2]);
}