function Composer::drupalVersionBranch

Same name in other branches
  1. 9 composer/Composer.php \Drupal\Composer\Composer::drupalVersionBranch()
  2. 10 composer/Composer.php \Drupal\Composer\Composer::drupalVersionBranch()
  3. 11.x composer/Composer.php \Drupal\Composer\Composer::drupalVersionBranch()

Return the branch name the current Drupal version is associated with.

Return value

string A branch name, e.g. 8.9.x or 9.0.x.

4 calls to Composer::drupalVersionBranch()
BuilderTest::builderTestData in core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php
Test data for testBuilder
ComposerProjectTemplatesTest::testTemplateCreateProject in core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php
@dataProvider provideTemplateCreateProject
DrupalCoreRecommendedBuilder::initialPackageMetadata in composer/Generator/Builder/DrupalCoreRecommendedBuilder.php
Returns the initial package metadata that describes the metapackage.
DrupalPinnedDevDependenciesBuilder::initialPackageMetadata in composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php
Returns the initial package metadata that describes the metapackage.

File

composer/Composer.php, line 48

Class

Composer
Provides static functions for composer script events. See also core/lib/Drupal/Composer/Composer.php, which contains similar scripts needed by projects that include drupal/core. Scripts that are only needed by drupal/drupal go here.

Namespace

Drupal\Composer

Code

public static function drupalVersionBranch() {
    return preg_replace('#\\.[0-9]+-dev#', '.x-dev', \Drupal::VERSION);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.