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