function Composer::drupalVersionBranch

Same name in other branches
  1. 8.9.x 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.

5 calls to Composer::drupalVersionBranch()
BuilderTest::builderTestData in core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php
Provides test data for testBuilder.
ComponentGenerator::getPackage in composer/Generator/ComponentGenerator.php
Reconcile component dependencies with core.
ComponentsIsolatedBuildTest::addExpectedRepositories in core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
Adds expected repositories as path repositories to package under test.
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 112

Class

Composer
Provides static functions for composer script events.

Namespace

Drupal\Composer

Code

public static function drupalVersionBranch() : string {
    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.