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

Breadcrumb

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

function ShowCommand::getUpdateStatus

2 calls to ShowCommand::getUpdateStatus()
ShowCommand::execute in vendor/composer/composer/src/Composer/Command/ShowCommand.php
Executes the current command.
ShowCommand::getVersionStyle in vendor/composer/composer/src/Composer/Command/ShowCommand.php

File

vendor/composer/composer/src/Composer/Command/ShowCommand.php, line 1428

Class

ShowCommand
@author Robert Schönthal <seroscho@googlemail.com> @author Jordi Boggiano <j.boggiano@seld.be> @author Jérémy Romey <jeremyFreeAgent> @author Mihai Plasoianu <mihai@plasoianu.de>

Namespace

Composer\Command

Code

private function getUpdateStatus(PackageInterface $latestPackage, PackageInterface $package) : string {
    if ($latestPackage->getFullPrettyVersion() === $package->getFullPrettyVersion()) {
        return 'up-to-date';
    }
    $constraint = $package->getVersion();
    if (0 !== strpos($constraint, 'dev-')) {
        $constraint = '^' . $constraint;
    }
    if ($latestPackage->getVersion() && Semver::satisfies($latestPackage->getVersion(), $constraint)) {
        // it needs an immediate semver-compliant upgrade
        return 'semver-safe-update';
    }
    // it needs an upgrade but has potential BC breaks so is not urgent
    return 'update-possible';
}

API Navigation

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