From 7b5fe5c7d42e6bfb0d550fffae70fe7277cd0b16 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Tue, 4 Oct 2016 10:40:18 +0200 Subject: [PATCH] CS --- src/Composer/DependencyResolver/RuleSet.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index aa841c4d9..20cd24654 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -60,10 +60,6 @@ class RuleSet implements \IteratorAggregate, \Countable $hash = $rule->getHash(); - if (!isset($this->rules[$type])) { - $this->rules[$type] = array(); - } - // Do not add if rule already exists if (isset($this->rulesByHash[$hash])) { $potentialDuplicates = $this->rulesByHash[$hash]; @@ -74,6 +70,10 @@ class RuleSet implements \IteratorAggregate, \Countable } } + if (!isset($this->rules[$type])) { + $this->rules[$type] = array(); + } + $this->rules[$type][] = $rule; $this->ruleById[$this->nextRuleId] = $rule; $rule->setType($type);