Fix handling of aliases to use consistent format everywhere
parent
a695f686c3
commit
64f907f93f
|
@ -122,8 +122,10 @@ class LockTransaction extends Transaction
|
|||
|
||||
foreach ($this->resultPackages['all'] as $package) {
|
||||
if ($package instanceof AliasPackage) {
|
||||
if (isset($aliases[$package->getName()])) {
|
||||
$usedAliases[$package->getName()] = $aliases[$package->getName()];
|
||||
foreach ($aliases as $alias) {
|
||||
if ($alias['package'] === $package->getName()) {
|
||||
$usedAliases[] = $alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317,24 +317,13 @@ class Locker
|
|||
'content-hash' => $this->contentHash,
|
||||
'packages' => null,
|
||||
'packages-dev' => null,
|
||||
'aliases' => array(),
|
||||
'aliases' => $aliases,
|
||||
'minimum-stability' => $minimumStability,
|
||||
'stability-flags' => $stabilityFlags,
|
||||
'prefer-stable' => $preferStable,
|
||||
'prefer-lowest' => $preferLowest,
|
||||
);
|
||||
|
||||
foreach ($aliases as $package => $versions) {
|
||||
foreach ($versions as $version => $alias) {
|
||||
$lock['aliases'][] = array(
|
||||
'alias' => $alias['alias'],
|
||||
'alias_normalized' => $alias['alias_normalized'],
|
||||
'version' => $version,
|
||||
'package' => $package,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$lock['packages'] = $this->lockPackages($packages);
|
||||
if (null !== $devPackages) {
|
||||
$lock['packages-dev'] = $this->lockPackages($devPackages);
|
||||
|
|
|
@ -46,12 +46,9 @@ class PoolBuilderTest extends TestCase
|
|||
}, $stabilityFlags);
|
||||
|
||||
$parser = new VersionParser();
|
||||
$normalizedAliases = array();
|
||||
foreach ($rootAliases as $alias) {
|
||||
$normalizedAliases[$alias['package']][$parser->normalize($alias['version'])] = array(
|
||||
'alias' => $alias['alias'],
|
||||
'alias_normalized' => $parser->normalize($alias['alias']),
|
||||
);
|
||||
foreach ($rootAliases as $index => $alias) {
|
||||
$rootAliases[$index]['version'] = $parser->normalize($alias['version']);
|
||||
$rootAliases[$index]['alias_normalized'] = $parser->normalize($alias['alias']);
|
||||
}
|
||||
|
||||
$loader = new ArrayLoader();
|
||||
|
@ -74,7 +71,7 @@ class PoolBuilderTest extends TestCase
|
|||
return $pkg;
|
||||
};
|
||||
|
||||
$repositorySet = new RepositorySet($minimumStability, $stabilityFlags, $normalizedAliases);
|
||||
$repositorySet = new RepositorySet($minimumStability, $stabilityFlags, $rootAliases);
|
||||
$repositorySet->addRepository($repo = new ArrayRepository());
|
||||
foreach ($packages as $package) {
|
||||
$repo->addPackage($loadPackage($package));
|
||||
|
|
Loading…
Reference in New Issue