diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index f7dd1c446..6d79a9678 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -55,7 +55,7 @@ class RuleSet implements \IteratorAggregate, \Countable public function add(Rule $rule, $type) { if (!isset(self::$types[$type])) { - throw OutOfBoundsException('Unknown rule type: ' . $type); + throw new \OutOfBoundsException('Unknown rule type: ' . $type); } if (!isset($this->rules[$type])) { diff --git a/src/Composer/DependencyResolver/RuleSetIterator.php b/src/Composer/DependencyResolver/RuleSetIterator.php index 46abb8ac7..63563ae51 100644 --- a/src/Composer/DependencyResolver/RuleSetIterator.php +++ b/src/Composer/DependencyResolver/RuleSetIterator.php @@ -88,6 +88,7 @@ class RuleSetIterator implements \Iterator public function valid() { - return isset($this->rules[$this->currentType][$this->currentOffset]); + return isset($this->rules[$this->currentType]) + && isset($this->rules[$this->currentType][$this->currentOffset]); } }