Get declared filters.

@return \Twig\TwigFilter[]
480183
public function getFilters(): array
    {
        return [
            new TwigFilter('serialize', 'serialize'),
            new TwigFilter('unserialize', 'unserialize'),
            new TwigFilter('md5', 'md5'),
            new TwigFilter('base64_encode', 'base64_encode'),
            new TwigFilter('base64_decode', 'base64_decode'),
            new TwigFilter('nl2br', 'nl2br'),
            new TwigFilter('string', function ($str) {
                return (string)$str;
            }),
        ];
    }
1101622
private function registerFilters()
    {
        $filters = config('app.render_filters', []);

        foreach ($filters as $filter) {
            $filter = app($filter);

            if ($filter instanceof FilterContract) {
                $this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $filter->getFilter()));
                $this->twigStringEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(),
                    $filter->getFilter()));
            }
        }
    }
1111368
public function allFilters()
    {
        $filters = [];
        foreach ($this->extensions() as $ext) {
            if (empty($this->_data[$ext][self::FILTERS])) {
                continue;
            }
            $filters = array_merge($filters, $this->_data[$ext][self::FILTERS]);
        }
        foreach ($this->_targets as $target) {
            if (empty($target[self::FILTERS])) {
                continue;
            }
            $filters = array_merge($filters, $target[self::FILTERS]);
        }
        return array_unique($filters);
    }
737606
public function getFilter()
    {
        $filter = [];
        $tag = $this->getRequest()->getVar("t");

        if ($tag) {
            $filter["Tags.URLSegment"] = $tag;
        }

        $this->extend("updateFilter", $filter);

        return $filter;
    }
1368734
protected function _getFilterFields()
    {
        $filterFields = [];

        foreach ($this->controller->filterFields as $field => $options) {
            if (isset($options['actions']) &&
                is_array($options['actions']) &&
                in_array($this->action, $options['actions'])
            ) {
                $filterFields[$field] = $options;
            }
        }

        return $filterFields;
    }
821171
public function getTagFilters()
    {
        if ($this->tagFilters === ['none']) {
            $result = null;
        } elseif ($this->tagFilters === ['all']) {
            $result = [];
        } else {
            $result = $this->tagFilters;
        }

        return $result;
    }
452781
public function getFilters()
    {
        $filters = [];

        $filters[] = new \Twig_Filter('date_format', [$this, 'filterDateFormat']);
        $filters[] = new \Twig_Filter('truncate', 'b_truncate');
        $filters[] = new \Twig_Filter('nl2p', 'b_nl2p', ['is_safe' => ['html']]);
        $filters[] = new \Twig_Filter('human_file_size', 'b_human_file_size');
        $filters[] = new \Twig_Filter('json_decode', 'json_decode');

        return $filters;
    }
1206272
public function getFilters()
    {
        // @todo build commong database filters for node datasource into some
        //   trait or abstract implemetnation to avoid duplicates
        return [
            (new Filter('status', $this->t("Published")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('promote', $this->t("Promoted to front page")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('sticky', $this->t("Sticky")))
                ->setChoicesMap([
                    1 => $this->t("Yes"),
                    0 => $this->t("No"),
                ]),
            (new Filter('type', $this->t("Type")))
                ->setChoicesMap(node_type_get_names()),
            (new Filter('history_user_id', $this->t("User (history)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
            (new Filter('revision_user_id', $this->t("User (node revision)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
            (new Filter('user_id', $this->t("User (node owner)"))),
                /* ->setChoicesMap(node_type_get_names()), @todo use callback */
        ];
    }
379336
public function getFunctions(): array
    {
        return [
            new TwigFunction('elementExists', function ($name) {
                return $this->view->elementExists($name);
            }),
            new TwigFunction('getVars', function () {
                return $this->view->getVars();
            }),
            new TwigFunction('get', function ($var, $default = null) {
                return $this->view->get($var, $default);
            }),
        ];
    }
1275335
public function getHandlers()
    {
        $filters = &gplcart_static('filter.handlers');

        if (isset($filters)) {
            return $filters;
        }

        $filters = array();
        $this->hook->attach('filter.handlers', $filters, $this);

        foreach ($filters as $id => &$filter) {
            $filter['filter_id'] = $id;
            $filter += array(
                'role_id' => array(),
                'status' => true,
                'module' => null
            );
        }

        return $filters;
    }
1158726
public function getAdditionalFilters() : array
    {
        // when we've build the additionalFilter once, we could return them
        if (count($this->additionalFilters) > 0) {
            return $this->additionalFilters;
        }

        $searchQueryFilters = $this->typoScriptConfiguration->getSearchQueryFilterConfiguration();
        if (!is_array($searchQueryFilters) || count($searchQueryFilters) <= 0) {
            return [];
        }

        $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);

        // all other regular filters
        foreach ($searchQueryFilters as $filterKey => $filter) {
            // the __pageSections filter should not be handled as additional filter
            if ($filterKey === '__pageSections') {
                continue;
            }

            $filterIsArray = is_array($searchQueryFilters[$filterKey]);
            if ($filterIsArray) {
                continue;
            }

            $hasSubConfiguration = is_array($searchQueryFilters[$filterKey . '.']);
            if ($hasSubConfiguration) {
                $filter = $cObj->stdWrap($searchQueryFilters[$filterKey], $searchQueryFilters[$filterKey . '.']);
            }

            $this->additionalFilters[$filterKey] = $filter;
        }

        return $this->additionalFilters;
    }
552789
private function getFilters($type)
    {
        $filters = [];
        if ('contao' === $type) {
            $filters[] =
                function ($package) {
                    /** @var PackageInterface $package */
                    return in_array($package->getType(), ['contao-module', 'contao-bundle', 'legacy-contao-module']);
                };
        }

        return $filters;
    }
103255
public function getFunctions(): array
    {
        $options = ['is_safe' => ['html']];
        return [
            new Twig_Function('logged_in_user', [$this, 'getLoggedInUser'], $options),
            new Twig_Function('msg', [$this, 'msg'], $options),
            new Twig_Function('bdi', [$this, 'bdi'], $options),
            new Twig_Function('msg_exists', [$this, 'msgExists'], $options),
            new Twig_Function('msg_if_exists', [$this, 'msgIfExists'], $options),
            new Twig_Function('lang', [$this, 'getLang'], $options),
            new Twig_Function('lang_name', [$this, 'getLangName'], $options),
            new Twig_Function('all_langs', [$this, 'getAllLangs']),
            new Twig_Function('is_rtl', [$this, 'isRtl']),
            new Twig_Function('git_branch', [$this, 'gitBranch']),
            new Twig_Function('git_hash', [$this, 'gitHash']),
            new Twig_Function('git_hash_short', [$this, 'gitHashShort']),
        ];
    }
841243
public function getFilters()
    {
        $roles = user_roles(true);
        unset($roles[DRUPAL_AUTHENTICATED_RID]);

        return [
            (new Filter('status', $this->t("Active")))->setChoicesMap(
                [
                    0 => $this->t("No"),
                    1 => $this->t("Yes"),
                ]
            ),
            (new Filter('role', $this->t("Role")))->setChoicesMap($roles),
            (new Filter('name', $this->t("Name"))),
        ];
    }
163182
public function getFilters()
    {
        $parser = \Parsedown::instance();
        $translator = $this->translator;
        $routeRenderer = $this->routeRenderer;

        return array(
            'markdown' => new \Twig_SimpleFilter(
                'markdown',
                function ($value) use ($parser) {
                    return $parser->text($value);
                }
            ),
            'trans' => new \Twig_SimpleFilter(
                'trans',
                function ($value, $context) use ($translator) {
                    if (!$context) {
                        $context = array();
                    }

                    return vsprintf($translator->translate($value), $context);
                }
            ),
            'route' => new \Twig_SimpleFilter(
                'route',
                function ($value, $presentation = 'normal') use ($routeRenderer) {
                    return $routeRenderer->render($value, $presentation);
                }
            ),
            'sort' => new \Twig_SimpleFilter(
                'sort_*',
                function ($direction, $collection) {
                    if (!$collection instanceof Collection) {
                        return $collection;
                    }

                    $iterator = $collection->getIterator();
                    $iterator->uasort(
                        function ($a, $b) use ($direction) {
                            $aElem = strtolower($a->getName());
                            $bElem = strtolower($b->getName());
                            if ($aElem === $bElem) {
                                return 0;
                            }
                            if ($direction === 'asc' && $aElem > $bElem || $direction === 'desc' && $aElem < $bElem) {
                                return 1;
                            }

                            return -1;
                        }
                    );

                    return $iterator;
                }
            ),
        );
    }
539785
public function getFilters()
    {
        if (null === $this->sorted) {
            if (!count($this->filters)) {
                $this->sorted = array();
            } else {
                ksort($this->filters);
                $this->sorted = call_user_func_array('array_merge', $this->filters);
            }
        }
        return $this->sorted;
    }
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;
    }