Yanick Witschi 8 年之前
父節點
當前提交
a9e88a27b3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/DependencyResolver/RuleSet.php

+ 2 - 2
src/Composer/DependencyResolver/RuleSet.php

@@ -58,12 +58,12 @@ class RuleSet implements \IteratorAggregate, \Countable
             throw new \OutOfBoundsException('Unknown rule type: ' . $type);
         }
 
+        $hash = $rule->getHash();
+
         if (!isset($this->rules[$type])) {
             $this->rules[$type] = array();
         }
 
-        $hash = $rule->getHash();
-
         // Do not add if rule already exists
         if (isset($this->rulesByHash[$hash])) {
             $potentialDuplicates = $this->rulesByHash[$hash];