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