Compare a single value against $this->value using $this->operator
@param string $value
@return bool
@throws FilterException
761024
protected function compare($value)
    {
        if (!method_exists($this, self::$methodList[$this->operator])) {
            throw new FilterException("Method for {$this->operator} does not exist!");
        }

        return $this->{self::$methodList[$this->operator]}($value, $this->value);
    }
1017529
public function apply($value)
    {
        $modified = false;

        foreach ($this->filters as $filter) {
            $result = $filter->apply($value);

            if ($result === false) {
                return false;
            } elseif ($result === true) {
            } else {
                $modified = true;
                $value    = $result;
            }
        }

        return $modified ? $value : true;
    }
410497
protected function filterValue($value, ?string $filter = null)
    {
        $resolver = $this->getFilterResolver($filter);

        if (\method_exists($resolver[0], $resolver[1])) {
            return $this->callFilterResolver($resolver, $value);
        }

        return $value;
    }
152909
public function evaluate($value) {
		switch ($this->comparison) {
			case '':
			case '=':
				foreach ($this->value as $value_item) {
					if ($value_item == $value) {
						return true;
					}
				}
				return false;
			case '!=':
			case '<>':
				foreach ($this->value as $value_item) {
					if ($value_item != $value) {
						return true;
					}
				}
				return false;
			case '<':
				foreach ($this->value as $value_item) {
					if ($value_item < $value) {
						return true;
					}
				}
				return false;
			case '>':
				foreach ($this->value as $value_item) {
					if ($value_item > $value) {
						return true;
					}
				}
				return false;
			case '<=':
				foreach ($this->value as $value_item) {
					if ($value_item <= $value) {
						return true;
					}
				}
				return false;
			case '>=':
				foreach ($this->value as $value_item) {
					if ($value_item >= $value) {
						return true;
					}
				}
				return false;
			default:
				throw new \Exception("Unsupported comparison operator: '" . $this->comparison . "'");
		}
	}
118331
protected function filter($value)
    {
        if (!$this->filters instanceof IFilterCollection) {
            return $value;
        }

        return $this->filters->filter($value);
    }
841127
public function filter(string $value) : int
    {
        return $this->getParser()->parse($this->getLexer()->tokenize($value));
    }
362000
protected function filterValue($value)
    {
        $filter = new Filter();

        call_user_func($this->callable, $filter);

        return $filter->filter($value);
    }
1343080
public function filter($value)
    {
        $filtered = null;
        if (!$this->validate($value, $filtered))
        {
            throw new \InvalidArgumentException(
                "Not a valid value for " . $this->__toString() . ": " . WF::str($value)
            );
        }

        return $filtered;
    }
720412
public function filter($value)
    {
        if (! is_array($value)) {
            // nothing to do
            return $value;
        }

        // Convert the date to a specific format
        if ($this->isNullOnEmpty()
            && array_reduce($value, __CLASS__ . '::reduce', false)
        ) {
            return;
        }

        if ($this->isNullOnAllEmpty()
            && array_reduce($value, __CLASS__ . '::reduce', true)
        ) {
            return;
        }

        $this->filterable($value);

        ksort($value);
        $value = vsprintf($this->format, $value);

        return $value;
    }
187766
public function filter($value)
    {
        return is_array($value) ? array_map(array($this, __FUNCTION__), $value) : stripslashes($value);
    }
1158819
public function filter($value)
    {
        $value = (string) $value;

        // Strip HTML comments first
        while (strpos($value, '<!--') !== false) {
            $pos   = strrpos($value, '<!--');
            $start = substr($value, 0, $pos);
            $value = substr($value, $pos);
            $value = preg_replace('/<(?:!(?:--[\s\S]*?--\s*)?(>))/us', '',  $value);
            $value = $start . $value;
        }

        // Initialize accumulator for filtered data
        $dataFiltered = '';
        // Parse the input data iteratively as regular pre-tag text followed by a
        // tag; either may be empty strings
        preg_match_all('/([^<]*)(<?[^>]*>?)/', (string) $value, $matches);

        // Iterate over each set of matches
        foreach ($matches[1] as $index => $preTag) {
            // If the pre-tag text is non-empty, strip any ">" characters from it
            if (strlen($preTag)) {
                $preTag = str_replace('>', '', $preTag);
            }
            // If a tag exists in this match, then filter the tag
            $tag = $matches[2][$index];
            if (strlen($tag)) {
                $tagFiltered = $this->_filterTag($tag);
            } else {
                $tagFiltered = '';
            }
            // Add the filtered pre-tag text and filtered tag to the data buffer
            $dataFiltered .= $preTag . $tagFiltered;
        }

        // Return the filtered data
        return $dataFiltered;
    }
471562
protected function matchType($value, &$filtered)
    {
        $o = $this->options;
        $min = $o['min_range'] ?? null;
        $max = $o['max_range'] ?? null;
        $strict = !($o['unstrict'] ?? false);

        switch ($this->type)
        {
            case Type::BOOL:
                if ($strict && !is_bool($value))
                    return false;
                $filtered = WF::parse_bool($value);
                return true;
            case Type::NUMERIC:
                if (!is_numeric($value))
                    return false;
                $filtered = WF::is_int_val($value) ? (int)$value : (float)$value;
                return $this->numRangeCheck($filtered, $min, $max);
            case Type::FLOAT:
                if ($strict && !is_float($value) && !is_int($value))
                    return false;
                $filtered = filter_var($value, FILTER_VALIDATE_FLOAT);
                return ($filtered !== false) && $this->numRangeCheck($filtered, $min, $max);
            case Type::INT:
                if (!is_int($value) && ($strict || !WF::is_int_val($value)))
                    return false;
                $filtered = (int)$value;
                return $this->numRangeCheck($filtered, $min, $max);
            case Type::STRING:
                if (!is_string($value) && ($strict || !is_scalar($value)))
                    return false;
                $filtered = (string)$value;
                if ($min !== null && strlen($value) < $min)
                    return false;
                if ($max !== null && strlen($value) > $max)
                    return false;
                if (isset($o['regex']) && !preg_match($o['regex'], $value))
                    return false;
                return true;
            case Type::SCALAR:
                return is_scalar($value);
            case Type::RESOURCE:
                return is_resource($value);
            case Type::DATE:
                // Attempt conversion
                if ($value instanceof \IntlCalendar)
                {
                    $value = $value->toDateTime();
                    $filtered = $value;
                }

                if (!($value instanceof \DateTimeInterface))
                {
                    if (!$strict && is_string($value) && !empty($value))
                    {
                        try
                        {
                            $value = new \DateTime($value);
                        }
                        catch (\Exception $e)
                        {
                            return false;
                        }
                    }
                    else
                        return false;

                    $filtered = $value;
                }

                if ($min instanceof \DateTimeInterface && $value < $min)
                    return false;
                if ($max instanceof \DateTimeInterface && $value > $max)
                    return false;
                return true;
            case Type::ARRAY:
                if (!WF::is_array_like($value))
                    return false;
                $filtered = WF::to_array($value);
                return true;
            case Validator::VALIDATE_FILTER:
                $ft = $o['filter'];
                unset($o['filter']);
                if ($ft === FILTER_VALIDATE_BOOLEAN)
                    $o['flags'] = FILTER_NULL_ON_FAILURE;

                $filtered = filter_var($value, $ft, $o);
                if ($ft === FILTER_VALIDATE_BOOLEAN)
                    return !($filtered === null);
                return $filtered !== false;
            case Type::OBJECT:
                if (!is_object($value))
                    return false;

                // Class, subclass or interface?
                if (isset($o['instanceof']) && !is_a($value, $o['instanceof']))
                    return false;

                // Specific class?
                if (isset($o['class']) && get_class($value) !== $o['class'])
                    return false;

                return true;
            default:
                // @codeCoverageIgnoreStart
                return false;
                // @codeCoverageIgnoreEnd
        }
    }
182590
public function equals($value) : self
    {
        if ($this->currentField) {
            $this->query[$this->currentField] = $value;
        } else {
            $this->query = $value;
        }
        return $this;
    }
546290
public function filter($value)
    {
        if (!is_string($value) && !is_array($value)) {
            return $value;
        }
        $result = @preg_replace($this->search, $this->replacement, $value);
        if ($result === null) {
            throw new FilterErrorException('An error occurred executing RegexReplace filter');
        }

        return $result;
    }
1255897
public function filter($value) : float
    {
        $float = $value;

        if ($value) {
            $float = str_replace(',', '.', $value);
        }

        return (float) $float;
    }
811095
public function filter($value)
    {
        if (!is_scalar($value) && !is_array($value)) {
            return $value;
        }

        return str_replace('-', $this->separator, $value);
    }
1140104
public function validate($value) {
        return (string)$value == (string)$this->filter($value) ? $value : Filter::ERR_INVALID;
    }