Browse Source

Properly limit to name matches only if necessary

Nils Adermann 11 years ago
parent
commit
bc7008270f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/Composer/DependencyResolver/Pool.php

+ 7 - 1
src/Composer/DependencyResolver/Pool.php

@@ -300,8 +300,14 @@ class Pool
             }
         }
 
+        if ($mustMatchName) {
+            return array_filter($matches, function ($match) use ($name) {
+                return $match->getName() == $name;
+            });
+        }
+
         // if a package with the required name exists, we ignore providers
-        if ($nameMatch || $mustMatchName) {
+        if ($nameMatch) {
             return $matches;
         }