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

Breadcrumb

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

function 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 201

Class

VersionParser
Version parser.

Namespace

Composer\Semver

Code

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

API Navigation

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