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;
    }
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;
    }
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 ; }
Add a filter rule for a spec

@param  mixed $spec
@param  mixed $ruleSet
@return self
Add a filter rule for a spec