浏览代码

Properly limit to name matches only if necessary

Nils Adermann 11 年之前
父节点
当前提交
bc7008270f
共有 1 个文件被更改,包括 7 次插入1 次删除
  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;
         }