You are here

public function VersionParser::parseNumericAliasPrefix in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/composer/semver/src/VersionParser.php \Composer\Semver\VersionParser::parseNumericAliasPrefix()

Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison.

Parameters

string $branch Branch name (e.g. 2.1.x-dev):

Return value

string|false Numeric prefix if present (e.g. 2.1.) or false

File

vendor/composer/semver/src/VersionParser.php, line 171

Class

VersionParser
Version parser.

Namespace

Composer\Semver

Code

public function parseNumericAliasPrefix($branch) {
  if (preg_match('{^(?P<version>(\\d+\\.)*\\d+)(?:\\.x)?-dev$}i', $branch, $matches)) {
    return $matches['version'] . '.';
  }
  return false;
}