src/Braincrafted/ArrayQuery/Evaluation.php
protected function evaluateFilter($value, $filter)
    {
        $filter = explode(' ', $filter, 2);
        if (1 === count($filter)) {
            $args   = [];
            $filter = $filter[0];
        } else {
            $args   = array_map('trim', explode(',', $filter[1]));
            $filter = $filter[0];
        }

        if (false === isset($this->filters[$filter])) {
            throw new UnkownFilterException(sprintf('The filter "%s" does not exist.', $filter));
        }

        return $this->filters[$filter]->evaluate($value, $args);
    }
protected function evaluateFilter($value, $filter)
    {
        $filter = explode(' ', $filter, 2);
        if (1 === count($filter)) {
            $args   = [];
            $filter = $filter[0];
        } else {
            $args   = array_map('trim', explode(',', $filter[1]));
            $filter = $filter[0];
        }

        if (false === isset($this->filters[$filter])) {
            throw new UnkownFilterException(sprintf('The filter "%s" does not exist.', $filter));
        }

        return $this->filters[$filter]->evaluate($value, $args);
    }
protected function evaluateFilter ( $ value , $ filter ) { $ filter = explode ( ' ' , $ filter , 2 ) ; if ( 1 === count ( $ filter ) ) { $ args = [ ] ; $ filter = $ filter [ 0 ] ; } else { $ args = array_map ( 'trim' , explode ( ',' , $ filter [ 1 ] ) ) ; $ filter = $ filter [ 0 ] ; } if ( false === isset ( $ this -> filters [ $ filter ] ) ) { throw new UnkownFilterException ( sprintf ( 'The filter "%s" does not exist.' , $ filter ) ) ; } return $ this -> filters [ $ filter ] -> evaluate ( $ value , $ args ) ; }
Evaluates the given value with the given filter.

@param mixed        $value
@param string|array $filter

@return mixed

@throws Braincrafted\ArrayQuery\Exception\UnkownFilterException if a filter does not exist.
Evaluates the given value with the given filter .