From dc2a9bfe6291f924ba221e73f308351997fefe8f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 17 Jun 2012 20:14:58 +0200 Subject: [PATCH] Ignore null rules in rule generator Fixes #806 --- src/Composer/DependencyResolver/RuleSetGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php index 260687755..95ca88ada 100644 --- a/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -127,14 +127,14 @@ class RuleSetGenerator * Adds a rule unless it duplicates an existing one of any type * * To be able to directly pass in the result of one of the rule creation - * methods. + * methods null is allowed which will not insert a rule. * * @param int $type A TYPE_* constant defining the rule type * @param Rule $newRule The rule about to be added */ private function addRule($type, Rule $newRule = null) { - if ($this->rules->containsEqual($newRule)) { + if (!$newRule || $this->rules->containsEqual($newRule)) { return; }