Przeglądaj źródła

Merge pull request #4324 from MalteWunsch/getCanonicalPackages-with-different-versions

Improve documentation for WritableRepositoryInterface::getCanonicalPackages
Jordi Boggiano 9 lat temu
rodzic
commit
bd23ce672a

+ 1 - 0
src/Composer/Repository/ArrayRepository.php

@@ -26,6 +26,7 @@ use Composer\Package\LinkConstraint\VersionConstraint;
  */
 class ArrayRepository implements RepositoryInterface
 {
+    /** @var PackageInterface[] */
     protected $packages;
 
     public function __construct(array $packages = array())

+ 1 - 1
src/Composer/Repository/WritableArrayRepository.php

@@ -42,7 +42,7 @@ class WritableArrayRepository extends ArrayRepository implements WritableReposit
     {
         $packages = $this->getPackages();
 
-        // get at most one package of each name, prefering non-aliased ones
+        // get at most one package of each name, preferring non-aliased ones
         $packagesByName = array();
         foreach ($packages as $package) {
             if (!isset($packagesByName[$package->getName()]) || $packagesByName[$package->getName()] instanceof AliasPackage) {

+ 2 - 2
src/Composer/Repository/WritableRepositoryInterface.php

@@ -41,14 +41,14 @@ interface WritableRepositoryInterface extends RepositoryInterface
     public function removePackage(PackageInterface $package);
 
     /**
-     * Get unique packages, with aliases resolved and removed
+     * Get unique packages (at most one package of each name), with aliases resolved and removed.
      *
      * @return PackageInterface[]
      */
     public function getCanonicalPackages();
 
     /**
-     * Forces a reload of all packages
+     * Forces a reload of all packages.
      */
     public function reload();
 }