original_string: public function addFilterRule($spec, $ruleSet)
      {
          $spec = $this->_normalizeSpec($spec);
          if (!isset($this->rules[$spec])) {
              $this->rules[$spec] = [];
          }
  
          if (!is_array($ruleSet)) {
              $ruleSet = [$ruleSet];
          }
  
          if (is_string($this->rules[$spec])) {
              $temp = $this->rules[$spec];
              $this->rules[$spec] = [];
              $this->rules[$spec][] = $temp;
          }
  
          foreach ($ruleSet as $rule) {
              $this->rules[$spec][] = $this->_getRule($rule);
          }
  
          return $this;
      }
code: public function addFilterRule($spec, $ruleSet)
      {
          $spec = $this->_normalizeSpec($spec);
          if (!isset($this->rules[$spec])) {
              $this->rules[$spec] = [];
          }
  
          if (!is_array($ruleSet)) {
              $ruleSet = [$ruleSet];
          }
  
          if (is_string($this->rules[$spec])) {
              $temp = $this->rules[$spec];
              $this->rules[$spec] = [];
              $this->rules[$spec][] = $temp;
          }
  
          foreach ($ruleSet as $rule) {
              $this->rules[$spec][] = $this->_getRule($rule);
          }
  
          return $this;
      }
code_tokens: public function addFilterRule ( $ spec , $ ruleSet ) { $ spec = $ this -> _normalizeSpec ( $ spec ) ; if ( ! isset ( $ this -> rules [ $ spec ] ) ) { $ this -> rules [ $ spec ] = [ ] ; } if ( ! is_array ( $ ruleSet ) ) { $ ruleSet = [ $ ruleSet ] ; } if ( is_string ( $ this -> rules [ $ spec ] ) ) { $ temp = $ this -> rules [ $ spec ] ; $ this -> rules [ $ spec ] = [ ] ; $ this -> rules [ $ spec ] [ ] = $ temp ; } foreach ( $ ruleSet as $ rule ) { $ this -> rules [ $ spec ] [ ] = $ this -> _getRule ( $ rule ) ; } return $ this ; }
docstring: Add a filter rule for a spec
  
  @param  mixed $spec
  @param  mixed $ruleSet
  @return self
docstring_tokens: Add a filter rule for a spec