protected function applyFilter($name, $value, $options = [])
    {
        // If the filter does not exist, throw an Exception:
        if (!isset($this->filters[$name])) {
            throw new InvalidArgumentException("No filter found by the name of $name");
        }

        $filter = $this->filters[$name];
        if ($filter instanceof Closure) {
            return call_user_func_array($filter, [$value, $options]);
        } else {
            $filter = new $filter;
            return $filter->apply($value, $options);
        }
    }
protected function applyFilter($name, $value, $options = [])
    {
        // If the filter does not exist, throw an Exception:
        if (!isset($this->filters[$name])) {
            throw new InvalidArgumentException("No filter found by the name of $name");
        }

        $filter = $this->filters[$name];
        if ($filter instanceof Closure) {
            return call_user_func_array($filter, [$value, $options]);
        } else {
            $filter = new $filter;
            return $filter->apply($value, $options);
        }
    }
protected function applyFilter ( $ name , $ value , $ options = [ ] ) { // If the filter does not exist, throw an Exception: if ( ! isset ( $ this -> filters [ $ name ] ) ) { throw new InvalidArgumentException ( "No filter found by the name of $name" ) ; } $ filter = $ this -> filters [ $ name ] ; if ( $ filter instanceof Closure ) { return call_user_func_array ( $ filter , [ $ value , $ options ] ) ; } else { $ filter = new $ filter ; return $ filter -> apply ( $ value , $ options ) ; } }
Apply the given filter by its name
@param  $name
@return Filter
Apply the given filter by its name