src/Sanitizer.php
protected function applyFilter($name, $value, $options = [])
    {
        $this->hasFilter($name);

        if (empty($value)) return $value;

        $filter = $this->filters[$name];

        if ($filter instanceof Closure) {
            return call_user_func_array($filter, compact('value', 'options'));
        }

        /** @var Filterable $filterable */
        $filterable = new $filter;

        return $filterable->filter($value, $options);
    }
protected function applyFilter($name, $value, $options = [])
    {
        $this->hasFilter($name);

        if (empty($value)) return $value;

        $filter = $this->filters[$name];

        if ($filter instanceof Closure) {
            return call_user_func_array($filter, compact('value', 'options'));
        }

        /** @var Filterable $filterable */
        $filterable = new $filter;

        return $filterable->filter($value, $options);
    }
protected function applyFilter ( $ name , $ value , $ options = [ ] ) { $ this -> hasFilter ( $ name ) ; if ( empty ( $ value ) ) return $ value ; $ filter = $ this -> filters [ $ name ] ; if ( $ filter instanceof Closure ) { return call_user_func_array ( $ filter , compact ( 'value' , 'options' ) ) ; } /** @var Filterable $filterable */ $ filterable = new $ filter ; return $ filterable -> filter ( $ value , $ options ) ; }
Apply the given filter by its name.

@param  string  $name
@param  mixed   $value
@param  array   $options

@return mixed
Apply the given filter by its name .