Bläddra i källkod

Remove support for the first version of the compression algo (#7906)

Jordi Boggiano 6 år sedan
förälder
incheckning
2e204b0161

+ 4 - 27
src/Composer/Package/Loader/ArrayLoader.php

@@ -62,39 +62,16 @@ class ArrayLoader implements LoaderInterface
 
     public function loadPackages(array $versions, $class)
     {
-        static $uniqKeys = array('version', 'version_normalized', 'source', 'dist', 'time');
-
         $packages = array();
         $linkCache = array();
 
         foreach ($versions as $version) {
-            if (isset($version['versions'])) {
-                $baseVersion = $version;
-                foreach ($uniqKeys as $key) {
-                    unset($baseVersion[$key.'s']);
-                }
-
-                foreach ($version['versions'] as $index => $dummy) {
-                    $unpackedVersion = $baseVersion;
-                    foreach ($uniqKeys as $key) {
-                        $unpackedVersion[$key] = $version[$key.'s'][$index];
-                    }
-
-                    $package = $this->createObject($unpackedVersion, $class);
+            $package = $this->createObject($version, $class);
 
-                    $this->configureCachedLinks($linkCache, $package, $unpackedVersion);
-                    $package = $this->configureObject($package, $unpackedVersion);
+            $this->configureCachedLinks($linkCache, $package, $version);
+            $package = $this->configureObject($package, $version);
 
-                    $packages[] = $package;
-                }
-            } else {
-                $package = $this->createObject($version, $class);
-
-                $this->configureCachedLinks($linkCache, $package, $version);
-                $package = $this->configureObject($package, $version);
-
-                $packages[] = $package;
-            }
+            $packages[] = $package;
         }
 
         return $packages;

+ 5 - 19
src/Composer/Repository/ComposerRepository.php

@@ -645,28 +645,14 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
                         unset($expanded, $expandedVersion, $versionData);
                     }
 
-                    static $uniqKeys = array('version', 'version_normalized', 'source', 'dist', 'time');
                     $versionsToLoad = array();
                     foreach ($versions as $version) {
-                        if (isset($version['version_normalizeds'])) {
-                            foreach ($version['version_normalizeds'] as $index => $normalizedVersion) {
-                                if (!$repo->isVersionAcceptable($isPackageAcceptableCallable, $constraint, $realName, $normalizedVersion)) {
-                                    foreach ($uniqKeys as $key) {
-                                        unset($version[$key.'s'][$index]);
-                                    }
-                                }
-                            }
-                            if (count($version['version_normalizeds'])) {
-                                $versionsToLoad[] = $version;
-                            }
-                        } else {
-                            if (!isset($version['version_normalized'])) {
-                                $version['version_normalized'] = $repo->versionParser->normalize($version['version']);
-                            }
+                        if (!isset($version['version_normalized'])) {
+                            $version['version_normalized'] = $repo->versionParser->normalize($version['version']);
+                        }
 
-                            if ($repo->isVersionAcceptable($isPackageAcceptableCallable, $constraint, $realName, $version['version_normalized'])) {
-                                $versionsToLoad[] = $version;
-                            }
+                        if ($repo->isVersionAcceptable($isPackageAcceptableCallable, $constraint, $realName, $version['version_normalized'])) {
+                            $versionsToLoad[] = $version;
                         }
                     }