src/Composer/DependencyResolver/RuleSetGenerator.php
private function addRule($type, Rule $newRule = null)
    {
        if (!$newRule || $this->rules->containsEqual($newRule)) {
            return;
        }

        $this->rules->add($newRule, $type);
    }
private function addRule($type, Rule $newRule = null)
    {
        if (!$newRule || $this->rules->containsEqual($newRule)) {
            return;
        }

        $this->rules->add($newRule, $type);
    }
private function addRule ( $ type , Rule $ newRule = null ) { if ( ! $ newRule || $ this -> rules -> containsEqual ( $ newRule ) ) { return ; } $ this -> rules -> add ( $ newRule , $ type ) ; }
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 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
Adds a rule unless it duplicates an existing one of any type