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

Breadcrumb

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

function Composer::getVersion

10 calls to Composer::getVersion()
AboutCommand::execute in vendor/composer/composer/src/Composer/Command/AboutCommand.php
Executes the current command.
Application::doRun in vendor/composer/composer/src/Composer/Console/Application.php
Runs the current application.
Application::__construct in vendor/composer/composer/src/Composer/Console/Application.php
Composer::ensureComposerVersion in composer/Composer.php
Ensure that the minimum required version of Composer is running.
DiagnoseCommand::checkComposerAudit in vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php

... See full list

File

vendor/composer/composer/src/Composer/Composer.php, line 70

Class

Composer
@author Jordi Boggiano <j.boggiano@seld.be> @author Konstantin Kudryashiv <ever.zet@gmail.com> @author Nils Adermann <naderman@naderman.de>

Namespace

Composer

Code

public static function getVersion() : string {
    // no replacement done, this must be a source checkout
    if (self::VERSION === '@package_version' . '@') {
        return self::SOURCE_VERSION;
    }
    // we have a branch alias and version is a commit id, this must be a snapshot build
    if (self::BRANCH_ALIAS_VERSION !== '' && Preg::isMatch('{^[a-f0-9]{40}$}', self::VERSION)) {
        return self::BRANCH_ALIAS_VERSION . '+' . self::VERSION;
    }
    return self::VERSION;
}

API Navigation

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