Exemple #1
0
 /**
  * @param Version $package
  * @return string
  */
 public function getVersionAlias(Version $package)
 {
     $extra = $package->getExtra();
     if (isset($extra['branch-alias'][$package->getVersion()])) {
         $parser = new VersionParser();
         $version = $parser->normalizeBranch(str_replace('-dev', '', $extra['branch-alias'][$package->getVersion()]));
         return preg_replace('{(\\.9{7})+}', '.x', $version);
     }
     return '';
 }
Exemple #2
0
 /**
  * Get all the branch aliases.
  *
  * @param ApiPackage\Version $version
  *
  * @return null|array
  */
 private function getBranchAliases(ApiPackage\Version $version)
 {
     $extra = $version->getExtra();
     if (null !== $extra && isset($extra["branch-alias"]) && is_array($extra["branch-alias"])) {
         return $extra["branch-alias"];
     }
     return null;
 }