Filters the iterator values.

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

        if ('\\' === \DIRECTORY_SEPARATOR) {
            $filename = str_replace('\\', '/', $filename);
        }

        return $this->isAccepted($filename);
    }
486562
public function clear(): bool {
        $this->heap = \array_fill(0, $this->maxSize, null);
        $this->heap[0] = \PHP_INT_MIN;
        return \count($this->heap) === 1 && $this->heap[0] === \PHP_INT_MIN;
    }
979538
public function filter(&$value) {
        $accepted_types = optional_param_array('accepted_types', '', PARAM_RAW);
        if (isset($value['children'])) {
            if (!empty($value['children'])) {
                $value['children'] = array_filter($value['children'], array($this, 'filter'));
            }
            return true; // always return directories
        } else {
            if ($accepted_types == '*' or empty($accepted_types)
                or (is_array($accepted_types) and in_array('*', $accepted_types))) {
                return true;
            } else {
                foreach ($accepted_types as $ext) {
                    if (preg_match('#'.$ext.'$#i', $value['title'])) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
88703
public function all(callable $iterator) : bool
    {
        foreach ($this as $k => $v) {
            if (!call_user_func($iterator, $v, $k, $this)) {
                return false;
            }
        }
        return true;
    }
1045398
protected function hasValue()
    {
        list($start, $end) = $this->getValue();
        return $start !== null && $start !== '' && $end !== null && $end !== '';
    }
332047
public function clean()
    {
        foreach ($this->cache as $key => $value) {
            list($expires, $value) = $value;
            if ($expires && ($expires < microtime(true))) {
                unset($this->cache[$key]);
            }
        }
        return true;
    }
260560
private function applyFilters()
    {
        // Only apply filters if this is mutable.
        if ($this->isImmutable) {
            return;
        }

        // Reset to original items before filtering.
        $this->exchangeArray($this->originalItems);

        // Apply filter to items.
        if (count($this->filters) > 0) {
            $filtered_array = array_filter(
                $this->getArrayCopy(),
                function ($item) {
                    foreach ($this->filters as $callback) {
                        if (call_user_func($callback, $item) === true) {
                            return true;
                        }
                    }
                    return false;
                }
            );
            $this->exchangeArray(array_values($filtered_array));
        }

        // Filter nested items.
        foreach ($this->getArrayCopy() as $item) {
            if ($item instanceof MultiValue) {
                foreach ($this->filters as $callback) {
                    $item->filter($callback);
                }
            }
        }
    }
296592
public function reject(callable $iterator) : Collection
    {
        return $this->filter(function ($v, $k, $array) use ($iterator) {
            return !call_user_func($iterator, $v, $k, $array);
        });
    }
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;
    }
999047
public function clear()
    {
        $result = true;
        $dir = new \DirectoryIterator($this->path);
        foreach ($dir as $file) {
            $extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
            if (!$file->isDot() && $extension === 'ser') {
                if (!@unlink($this->path.'/'.$file->getFilename())) {
                    $result = false;
                }
            }
        }

        return $result;
    }
64606
public function filter($value)
    {
        return isset($this->actionToStatusMap[$value])
            ? $this->actionToStatusMap[$value]
            : false;
    }
914568
private function hasAtLeastOneFilter()
    {
        $columns = $this->options[self::GRID_PARAM_COLUMNS];

        foreach ($columns as $column) {
            if (isset($column[self::GRID_PARAM_FILTER]) && $column[self::GRID_PARAM_FILTER] == true) {
                return true;
            }
        }

        return false;
    }
1080825
protected function _dirty()
    {
        $this->_dirty = true;

        if ($this->_iterator && $this->_valueBinder) {
            $this->getValueBinder()->reset();
        }
    }
864591
protected function clearValues()
    {
        $nPath = $this->getNamespacePath();
        $dp = @opendir($nPath);
        while ($file = @readdir($dp)) {
            if ('.' === $file || '..' === $file) {
                continue;
            }
            $cur_file = "{$nPath}/{$file}";
            if (is_file($cur_file)) {
                @unlink($cur_file);
            }
        }
        @closedir($dp);
        @rmdir($nPath);
        return true;
    }
221957
public function exceptValues($excluded = [])
    {
        Arguments::define(
            Boa::arrOf(
                Boa::either(
                    Boa::string(),
                    Boa::integer()
                )
            )
        )->check($excluded);

        return $this->filter(
            function ($value) use ($excluded) {
                return !in_array($value, $excluded);
            }
        );
    }
377420
public function valid()
    {

        if ($this->container['region'] === null) {
            return false;
        }
        $allowed_values = $this->getRegionAllowableValues();
        if (!in_array($this->container['region'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineType'] === null) {
            return false;
        }
        $allowed_values = $this->getMachineTypeAllowableValues();
        if (!in_array($this->container['machineType'], $allowed_values)) {
            return false;
        }
        if ($this->container['size'] === null) {
            return false;
        }
        if ($this->container['billingType'] === null) {
            return false;
        }
        $allowed_values = $this->getBillingTypeAllowableValues();
        if (!in_array($this->container['billingType'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineName'] === null) {
            return false;
        }
        if ($this->container['templateId'] === null) {
            return false;
        }
        return true;
    }
152976
public function getFilteredValue() {
        if(!$this->getSanitizer() instanceof Sanitizer) {
            throw new \Exception('You have to assign a sanitizer first!');
        }
        
        return $this->getSanitizer()->filter($this->getRawValue());
    }