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

Breadcrumb

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

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

PreReleaseSuffix

Namespace

PharIo\Version

Code

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

API Navigation

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