private function addFilter($filter)
    {
        if (is_array($filter)) {
            if (!isset($filter['method'])) {
                throw new \InvalidArgumentException(
                    'A [method] value must be specified for each complex filter'
                );
            }
        }

        if (!$this->filters) {
            $this->filters = [$filter];
        } else {
            $this->filters[] = $filter;
        }

        return $this;
    }
private function addFilter($filter)
    {
        if (is_array($filter)) {
            if (!isset($filter['method'])) {
                throw new \InvalidArgumentException(
                    'A [method] value must be specified for each complex filter'
                );
            }
        }

        if (!$this->filters) {
            $this->filters = [$filter];
        } else {
            $this->filters[] = $filter;
        }

        return $this;
    }
private function addFilter ( $ filter ) { if ( is_array ( $ filter ) ) { if ( ! isset ( $ filter [ 'method' ] ) ) { throw new \ InvalidArgumentException ( 'A [method] value must be specified for each complex filter' ) ; } } if ( ! $ this -> filters ) { $ this -> filters = [ $ filter ] ; } else { $ this -> filters [ ] = $ filter ; } return $ this ; }
Add a filter to the parameter

@param string|array $filter Method to filter the value through

@return self
@throws \InvalidArgumentException
Add a filter to the parameter