original_string: public function setRule($rule, $replacement)
      {
          if (is_array($rule)) {
              $this->rules = $rule;
              return $this;
          }
  
          $this->rules[$rule] = $replacement;
          return $this;
      }
code: public function setRule($rule, $replacement)
      {
          if (is_array($rule)) {
              $this->rules = $rule;
              return $this;
          }
  
          $this->rules[$rule] = $replacement;
          return $this;
      }
code_tokens: public function setRule ( $ rule , $ replacement ) { if ( is_array ( $ rule ) ) { $ this -> rules = $ rule ; return $ this ; } $ this -> rules [ $ rule ] = $ replacement ; return $ this ; }
docstring: Adds a rule
  @param string|array $rule A single RegExp pattern or array of rules
  @param string $replacement A replacement HTML string or callable method
  @return $this
docstring_tokens: Adds a rule