You are here

public function VersionParser::parseNumericAliasPrefix in Automatic Updates 7

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 186

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