public function setRule($rule, $replacement)
    {
        if (is_array($rule)) {
            $this->rules = $rule;
            return $this;
        }

        $this->rules[$rule] = $replacement;
        return $this;
    }
public function setRule($rule, $replacement)
    {
        if (is_array($rule)) {
            $this->rules = $rule;
            return $this;
        }

        $this->rules[$rule] = $replacement;
        return $this;
    }
public function setRule ( $ rule , $ replacement ) { if ( is_array ( $ rule ) ) { $ this -> rules = $ rule ; return $ this ; } $ this -> rules [ $ rule ] = $ replacement ; return $ this ; }
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
Adds a rule