returns reusable filter instance

@return  \stubbles\input\Filter
550043
public static function instance(): Filter
    {
        if (null === self::$instance) {
            self::$instance = new self();
        }

        return self::$instance;
    }
322934
protected function createFilter()
    {
        $model = Str::studly(class_basename($this->argument('name')));

        $this->call('make:filter', [
            'name' => $model.'Filter',
        ]);
    }
1012283
public function filter($filter = null)
    {
        if (is_null($filter)) {
            return $this->filter;
        } else {
            $this->filter = $filter;
        }
    }
1301720
protected function checkFilters()
    {
        if ($this->getModelInformation()->list->disable_filters) {
            return $this;
        }

        if ($this->getListMemory()->hasFilters()) {
            $this->retrieveFiltersFromSession();
        }

        return $this;
    }
73945
protected function filter()
	{
		foreach ($this->filters as $attribute => $filters) {
			// Check if the attribute is present in the input data
			if (!array_key_exists($attribute, $this->data)) {
				continue;
			}

			$data = $this->data[$attribute];

			foreach ($filters as $filter) {
				// The format for specifying filter and parameters follows an
				// easy {filter}:{parameters} formatting convention.
				if (strpos($filter, ':') !== false) {
					list($filter, $parameterList) = explode(':', $filter, 2);
					$parameters = explode(',', $parameterList);
				} else {
					$parameters = [];
				}
				
				if (method_exists($this, $this->camelCase($filter))) {
					$data = $this->filterWalker($filter, $data, $parameters);
				} elseif (isset($this->extensions[$filter])) {
					$data = $this->filterExtensionWalker($filter, $data, $parameters);
				} else {
					throw new \Exception("'$filter' is not a valid filter.");
				}
			}

			$this->filteredData[$attribute] = $data;
		}

		return $this->filteredData;
	}
1304745
protected function getSearchFilter()
    {
        $pattern = $this->getRequest()->getQuery('pattern', null);
        $pattern = StaticFilter::filter('text', $pattern);
        $this->set('pattern', $pattern);
        
        return new SearchFilter(['pattern' => $pattern]);
    }
1322141
public function filter()
    {
        return (object) [
            'type' => $this->_indexType,
            'filters' => $this->_comparisons,
            'order' => $this->_orderBy,
            'reverse' => $this->_reverse,
            'offset' => $this->_offset,
            'length' => $this->_length
        ];
    }
979438
public function getIterator(IteratorFilter $filter = null)
    {
        if (is_null($filter)) {
            $filter = new IteratorFilter();
        }

        $param = [];
        $formatter = new IteratorFilterSqlFormatter();
        $sql = $formatter->getFilter($filter->getRawFilters(), $param);

        $query = Query::getInstance()
            ->table($this->getUserDefinition()->table())
            ->where($sql, $param);

        return $this->userRepository->getByQuery($query);
    }
312023
protected function disableFilters()
    {
        $previous = SqlFilterUtil::findFilters($this->om, $this->disableFilters);
        SqlFilterUtil::disableFilters($this->om, $previous);

        return $previous;
    }
39690
public function encapsulateOr()
    {
        $root = $this->filters;

        $this->filters = new AndFilterBuilder();
        $this->filters->setBuilder($this);

        $orFilter = new OrFilterBuilder([$root]);
        $this->filters->add($orFilter);

        return $orFilter;
    }
430321
public function filter()
    {
        $widgets = $this->applyFilters();

        return $widgets->sortBy(function (AbstractWidget $w1) {
            return $w1->getOrder();
        });
    }
1126298
public function getFilterOptionsForDcGeneral()
    {
        if (!$this->isFilterOptionRetrievingPossible(null)) {
            return array();
        }

        $values = $this->getFilterOptionsForUsedOnly(false);
        return $this->convertOptionsList($values, $this->getIdColumn(), $this->getValueColumn());
    }
250658
public function getFilters()
    {
        //get the model's filter fields
        $configFilters = $this->config->getOption('filters');

        //make sure that the filters array hasn't been created before and that there are supplied filters in the config
        if (empty($this->filters) && $configFilters) {
            //iterate over the filters and create field objects for them
            foreach ($configFilters as $name => $filter) {
                if ($fieldObject = $this->make($name, $filter)) {
                    //the filters array is indexed on the field name and holds the arrayed values for the filters
                    $this->filters[$fieldObject->getOption('field_name')] = $fieldObject;
                }
            }
        }

        return $this->filters;
    }
119316
protected function getCustomFilters()
    {
        $filters = (array) $this->getOption('custom_filters');

        return array_filter(
            $filters,
            function ($name) {
                return is_string($name);
            },
            ARRAY_FILTER_USE_KEY
        );
    }
1139915
public function buildFilters()
	{
		$this->setFilterMapper(new FilterMapper);
		$this->configureFilters($this->getFilterMapper());

		$this->setFilterBuilder(new FilterBuilder($this->getFilterMapper()));
		$this->getFilterBuilder()
			->build();

		return $this;
	}
1036177
protected function _createFilter()
    {
        $config = array();
        $config['separator'] = $this->_separator;

        if (!isset($this->_length)) {
            $config['length'] = $this->getTable()->getColumn('slug')->length;
        } else {
            $config['length'] = $this->_length;
        }

        return $this->getObject('filter.factory')->createChain($this->_filter, $config);
    }
1369115
private function filter()
    {
        if ($this->allowsFilter()) {
            if ($this->hasFilters()) {
                $tmp = [];
                foreach ($this->filters as $filter) {
                    // check, if it is a "forbidden" query parameter
                    if ($this->isExcludedParameter($filter['key'])) {
                        continue;
                    }
                    $tmp[] = $filter;
                }

                $this->filters = $tmp;

                return $this->operator->filter($this->filters);
            }
        }
    }