You are here

protected function StabilityFlags::getParsedStability in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/wikimedia/composer-merge-plugin/src/Merge/StabilityFlags.php \Wikimedia\Composer\Merge\StabilityFlags::getParsedStability()

Get the stability of a version

Parameters

string $version:

Return value

int|null Stability or null if STABLE or less than minimum

1 call to StabilityFlags::getParsedStability()
StabilityFlags::extractAll in vendor/wikimedia/composer-merge-plugin/src/Merge/StabilityFlags.php
Extract and merge stability flags from the given collection of requires with another collection of stability flags.

File

vendor/wikimedia/composer-merge-plugin/src/Merge/StabilityFlags.php, line 149

Class

StabilityFlags
Adapted from Composer's RootPackageLoader::extractStabilityFlags @author Bryan Davis <bd808@bd808.com>

Namespace

Wikimedia\Composer\Merge

Code

protected function getParsedStability($version) {

  // Drop aliasing if used
  $version = preg_replace('/^([^,\\s@]+) as .+$/', '$1', $version);
  $stability = $this
    ->getStabilityInt(VersionParser::parseStability($version));
  if ($stability === BasePackage::STABILITY_STABLE || $this->minimumStability > $stability) {

    // Ignore if 'stable' or more stable than the global
    // minimum
    $stability = null;
  }
  return $stability;
}