You are here

protected function StabilityFlags::getExplicitStability in Zircon Profile 8

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

Extract the most unstable explicit stability (eg '@dev') from a version specification.

Parameters

string $version:

Return value

int|null Stability or null if no explict stability found

1 call to StabilityFlags::getExplicitStability()
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 106

Class

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

Namespace

Wikimedia\Composer\Merge

Code

protected function getExplicitStability($version) {
  $found = null;
  $constraints = $this
    ->splitConstraints($version);
  foreach ($constraints as $constraint) {
    if (preg_match($this->explicitStabilityRe, $constraint, $match)) {
      $stability = $this
        ->getStabilityInt($match[1]);
      $found = max($stability, $found);
    }
  }
  return $found;
}