Filters the iterator values.

@return bool true if the value should be kept, false otherwise
506763
public function accept()
    {
        $fileinfo = $this->current();

        foreach ($this->filters as $filter) {
            if (false === $filter($fileinfo)) {
                return false;
            }
        }

        return true;
    }
838571
public function isFilterable()
    {
        $hasFilters = false;

        foreach ($this->columns as $column) {
            if ($column->isFilterable()) {
                $hasFilters = true;
                break;
            }
        }

        return $hasFilters;
    }
817474
protected function checkFilters()
    {
        $current = $this->prepareForReturn($this->current);

        foreach ($this->filters as $tuple) {
            $result = call_user_func(
                $tuple[0],
                $current->copy(),
                $this->key,
                $this
            );

            if ($result === static::END_ITERATION) {
                return static::END_ITERATION;
            }

            if (!$result) {
                return false;
            }
        }

        return true;
    }
250319
protected function filterOutArrayValues($values = null, \Closure $filter = null, $preserveKeys = false)
    {
        $data = [];

        if (is_array($values) && count($values))
        {
            foreach ($values as $key => $value)
            {
                $value = trim($value);

                if (!empty($value))
                {
                    if (is_callable($filter) && $filter($value))
                    {
                        $data[$key] = $value;
                    }
                }
            }

            if (!$preserveKeys)
            {
                $data = array_values($data);
            }
        }

        return $data;
    }
973222
public function filterPosters()
    {
        return $this->filter(
            function ($key, $value) {
                if ($value instanceof ImageFilter && $value instanceof Image\PosterImage) {
                    return true;
                }
            }
        );
    }
735796
public function valid()
  {

    $allowedValues = $this->getExclusionTypeAllowableValues();
    if (!in_array($this->container['exclusion_type'], $allowedValues)) {
      return false;
    }
    return true;
  }
329418
public function clear()
	{
		$filePath = $this->options['file.path'];
		$this->checkFilePath($filePath);

		$iterator = new \RegexIterator(
			new \RecursiveIteratorIterator(
				new \RecursiveDirectoryIterator($filePath)
			),
			'/\.data$/i'
		);

		/* @var  \RecursiveDirectoryIterator  $file */
		foreach ($iterator as $file)
		{
			if ($file->isFile())
			{
				@unlink($file->getRealPath());
			}
		}

		return true;
	}
947249
public function filtersOnID()
    {
        $regexp = '/^(.*\.)?("|`)?ID("|`)?\s?(=|IN)/';

        foreach ($this->getWhereParameterised($parameters) as $predicate) {
            if (preg_match($regexp, $predicate)) {
                return true;
            }
        }

        return false;
    }
779770
public function filterValues(array $values = null)
    {
        if (null === $values) {
            $values = $this->getFields();
        }
        foreach ($values as $key => $value) {
            $values[$key] = $this->filterValue($value);
        }
        return $values;
    }
445804
private function isResourceName(\ArrayIterator $iterator): bool
    {
        return !(
            $this->isTTL($iterator) ||
            Classes::isValid(strtoupper($iterator->current())) ||
            RDataTypes::isValid(strtoupper($iterator->current()))
        );
    }
1236131
private function getApplyValue()
    {
        $value = $this->getValue();

        if (is_array($this->getApplyFilterValue())) {
            $value = $this->getApplyFilterValue();
        }

        if (is_array($value) && count($value) == 1) {
            $value = current($value);
        }

        return $value;
    }
889737
protected function parseFilter()
    {
        if (! $params = $this->getParams()) {
            return;
        }

        foreach ($params as $key => $value) {
            if ($this->isEloquentBuilder() && Str::contains($key, '~')) {
                $this->filterRelation($key, $value);
            } else {
                $this->filter($key, $value);
            }
        }
    }
695186
private void filter(ValueSet filterValueSet, ValueSet valueSet) {
        if (filterValueSet != null && valueSet != null && !filterValueSet.isEmpty() && !valueSet.isEmpty()) {
            Iterator it = filterValueSet.iterator();
            while (it.hasNext()) {
                Object o = it.next();
                if (valueSet.contains(o)) {
                    it.remove();
                }
            }
        }
    }
225282
public function removeByValue($value): bool {
        if (!$this->containsValue($value)) {
            return true;
        }
        $key = $this->indexOf($value);
        $removed = $this->remove($key);
        return $removed;
    }
856484
public function dataValid()
    {
        foreach (new \RecursiveIteratorIterator($this,
                                                \RecursiveIteratorIterator::SELF_FIRST) as $child) {
            if ($child instanceof FormElement && !$child->dataValid()) {
                return false;
            }
        }

        return true;
    }
1322141
public function filter()
    {
        return (object) [
            'type' => $this->_indexType,
            'filters' => $this->_comparisons,
            'order' => $this->_orderBy,
            'reverse' => $this->_reverse,
            'offset' => $this->_offset,
            'length' => $this->_length
        ];
    }
135904
public function activeFilters()
    {
        $state = $this->activeState();

        $result = [];
        foreach ($state->activeFilters() as $name) {
            if (!isset($this->filters[$name])) {
                //No such filter
                continue;
            }

            $filter = $this->filters[$name];
            $value = $state->getValue($name);

            if ($filter->isApplicable($value)) {
                $result[$name] = $filter->withValue($value);
            }
        }

        return $result;
    }