execute the filter on a value
@param mixed $value
@return mixed
@throws FilterException
15260
public function filter($value) {
    	    	
    	$value   = str_replace(["\r", "\r\n", "\n"], '', $value);
    	$decoded = json_decode($value,true);
    	if(is_null($decoded)){
    		return null;
    	}    	
    	
    	switch($this->options["format"]){
    	    case self::DECODED:
    	        return $decoded;
    	    case self::JSON:
    	        return $value;
    	    case self::SERIALIZED:
    	        return serialize($decoded);
    	    default:
    	        throw new FilterException("unknown format for JSON filter specified");
    	}
    }
223740
public static function _($value, $filters = 'raw')
    {
        if (is_string($filters)) {
            $filters = Str::trim($filters);
            $filters = explode(',', $filters);

            if (count($filters) > 0) {
                foreach ($filters as $filter) {
                    $filterName = self::cmd($filter);

                    if ($filterName) {
                        if (method_exists(__CLASS__, $filterName)) {
                            $value = self::$filterName($value);
                        } else {
                            throw new Exception('Undefined filter method: ' . $filter);
                        }
                    }
                }
            }
        } elseif ($filters instanceof \Closure) {
            $value = $filters($value);
        }

        return $value;
    }
1138835
public function filter($value)
    {
        if (null === $value) {
            return null;
        }
        $this->checkValueIsValidOrThrowException($value);
        $matcher = key($value);
        $this->validateMatcherOrThrowException($matcher);
        $this->validateValueOrThrowException($value[$matcher]);

        return new Condition($matcher, $value[$matcher]);
    }
28057
private function filter(string $value) : string
    {
        foreach ($this->filters as $filter) {
            $value = $filter($value);
        }

        return $value;
    }
5365
public function filter($value)
    {
        // Formats are applied exclusively and supersed filters
        if ($this->format) {
            if (!$this->serviceDescription) {
                throw new \RuntimeException('No service description was set so '
                    . 'the value cannot be formatted.');
            }
            return $this->serviceDescription->format($this->format, $value);
        }

        // Convert Boolean values
        if ($this->type == 'boolean' && !is_bool($value)) {
            $value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
        }

        // Apply filters to the value
        if ($this->filters) {
            foreach ($this->filters as $filter) {
                if (is_array($filter)) {
                    // Convert complex filters that hold value place holders
                    foreach ($filter['args'] as &$data) {
                        if ($data == '@value') {
                            $data = $value;
                        } elseif ($data == '@api') {
                            $data = $this;
                        }
                    }
                    $value = call_user_func_array(
                        $filter['method'],
                        $filter['args']
                    );
                } else {
                    $value = call_user_func($filter, $value);
                }
            }
        }

        return $value;
    }
451049
public function filter($value) {

        $testvalue = $this->options["insensitive"] ? strtolower($value): $value;

        // Value is not in enumeration
        if (!in_array($testvalue, $this->enumeration, $this->options["strict"]))
            return Filter::ERR_INVALID;

        $found = array_search($value, $this->enumeration, $this->options["strict"]);

        return $this->options["values"][$found];
    }
926189
public function executeFilter($eventName, $value = null)
    {
        return $this->executeItems(self::FILTER, $eventName, $value);
    }
25900
public function filter($value)
    {
        if (!is_scalar($value)) {
            return $value;
        }
        $value = (string) $value;

        if (null !== $this->getEncoding()) {
            return mb_strtolower($value, $this->options['encoding']);
        }

        return strtolower($value);
    }
916989
public function filter($value)
    {
        if (!is_string($value) && !is_array($value)) {
            return $value;
        }
        return str_replace($this->search, $this->replacement, $value);
    }
678479
public function filter($value, $options = [])
    {
        if ($this->getPattern() == null) {
            $ex = new \Exception(get_class($this) . ' does not have a valid MatchPattern set.');
            throw $ex;
        }

        return preg_replace($this->getPattern(), $this->getReplacement(), $value);
    }
1355551
public function filter($value)
    {
        $filtered = parent::filter($value);
        return null === $filtered ? false : $filtered;
    }
882842
public function filter($value)
    {
        if (null === $value || (is_string($value) && strlen($value) === 0)) {
            return null;
        }

        return Money::stringToUnits($value);
    }
1233216
public function where($filter, $value = null)
    {
        foreach ($this->queries as $query) {
            $query->where($filter, $value);
        }

        return $this;
    }
411069
public function filter($value)
    {
        if (!is_scalar($value)) {
            return $value;
        }
        $value = (string) $value;

        return (int) $value;
    }
1251325
public function filter($value)
    {
        if (!is_string($value)) {
            return $value;
        }
        return $this->allWords ? ucwords(strtolower($value)) : ucfirst(strtolower($value));
    }
288669
public function filter($value)
    {
        /** @var InputFilterInterface $filter */
        foreach ($this->filters as $filter) {
            if (true === is_array($value)) {
                $values = array();
                foreach ($value as $child) {
                    if (null !== $filtered = $filter->filter($child)) {
                        $values[] = $filtered;
                    }
                }
                $value = $values;
            } else {
                $value = $filter->filter($value);
            }
        }

        return $value;
    }
1026591
protected function filterValue($value)
    {
        if ($this->canFilterValue()) {
            return app('sleeping_owl.wysiwyg')->applyFilter($this->getEditor(), $value);
        }

        return $value;
    }