private function aliasPlatformPackages(PlatformRepository $platformRepo, $aliases)
 {
     foreach ($aliases as $package => $versions) {
         foreach ($versions as $version => $alias) {
             $packages = $platformRepo->findPackages($package, $version);
             foreach ($packages as $package) {
                 $aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']);
                 $aliasPackage->setRootPackageAlias(true);
                 $platformRepo->addPackage($aliasPackage);
             }
         }
     }
 }
Exemple #2
0
 private function aliasPackages(PlatformRepository $platformRepo)
 {
     if (!$this->update && $this->locker->isLocked()) {
         $aliases = $this->locker->getAliases();
     } else {
         $aliases = $this->package->getAliases();
     }
     foreach ($aliases as $alias) {
         $packages = array_merge($platformRepo->findPackages($alias['package'], $alias['version']), $this->repositoryManager->findPackages($alias['package'], $alias['version']));
         foreach ($packages as $package) {
             $package->setAlias($alias['alias_normalized']);
             $package->setPrettyAlias($alias['alias']);
             $package->getRepository()->addPackage($aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']));
             $aliasPackage->setRootPackageAlias(true);
         }
     }
     return $aliases;
 }