Add a new filter.

@param FilterInterface $filter
@param int             $priority range 0-99.

@return FilterChainInterface
@throws \InvalidArgumentException
@throws InvalidFilterException
961896
public function addFilter(FilterInterface $filter, $priority = 0)
	{
		$this->filters->insert($filter, [-$priority, $this->serial--]);
		
		return $this;
	}
683879
public function addHandler(HandlerInterface $handler, $priority = 0)
    {
        if (filter_var($priority, FILTER_VALIDATE_INT) === false) {
            throw new InvalidArgumentException("Argument 'priority' should be an integer, got '$priority'");
        }

        if ($this->handlerAlreadyRegistered($handler)) {
            return;
        }

        $this->handlers[$priority][] = $handler;
    }
1013669
public function filter($filter)
    {
        $callback = is_array($filter) ? $this->_filterFromArray($filter) : $filter;
        $data = array_filter($this->_data, $callback);
        return new static($data);
    }
78516
public function add($name, $filter, array $options = [])
    {
        $this->_filters[$name] = $this->_loadFilter($name, $filter, $options);

        return $this;
    }
439039
public function addMenuFilter(
        MenuFilterInterface $menuFilter,
        array $menus,
        $stage,
        $priority
    ) {
        $this->addElement(
            $menuFilter,
            $menus,
            $stage,
            $priority
        );

        return $this;
    }
490964
public function addFilter($operator, PointcutFilterInterface $filter): void
    {
        $this->filters[] = [$operator, $filter];
        if ($operator !== '&&' && $operator !== '&&!') {
            $this->earlyReturn = false;
        }
    }
62560
public static function create($filter)
    {
        if (array_key_exists($filter, static::$filters)) {
            $class = static::$filters[$filter];
        } else if (
        is_subclass_of($filter, 'Slick\Filter\FilterInterface')
        ) {
            $class = $filter;
        } else {
            throw new Exception\UnknownFilterClassException(
                "The filter '{$filter}' is not defined or does not " .
                "implements the Slick\\Filter\\FilterInterface interface"
            );
        }

        return new $class();
    }
1323499
protected function addFilter($name, $callback, $priority, $accepted_args)
    {
        add_filter($name, $callback, $priority, $accepted_args);
    }
1135812
public function removeFilterHandler($filterName, $filterHandlerName, $priority = 50)
    {
        $this->removeHandler(self::FILTER, $filterName, $filterHandlerName, $priority);
    }
747767
protected function createFilter($filter)
    {
        if (is_callable($filter)) {
            return call_user_func($filter);
        } elseif (is_string($filter)) {
            return new $filter();
        } elseif (is_object($filter)) {
            return $filter;
        } else {
            throw new \InvalidArgumentException("Cannot convert $filter to filter");
        }
    }
1033261
public function addFilter(FilterInterface $filter) : Reader
    {
        foreach ($this->parsers as $parser) {
            $parser->addFilter($filter);
        }

        return $this;
    }
315127
public function addInitializer(InitializerInterface $initializer, int $priority = 0)
    {
        if (empty($this->initializers[$priority])) {
            $this->initializers[$priority] = [];
        }

        $this->initializers[$priority][] = $initializer;
        $this->sortedInitializers = [];
    }
1078788
def add_filter(self, filter):
        
        if not isinstance(filter, AbstractFilter):
            err = 'Filters must be of type {}'.format(AbstractFilter)
            raise InvalidFilter(err)

        if filter not in self.filters:
            self.filters.append(filter)
        return self
941142
public function filter($name, $callable, $priority = 10, $override = false)
    {
        if ($override) {
            $this->clearFilters($name);
        }

        if (!isset($this->filters[$name])) {
            $this->filters[$name] = array(array());
        }
        if (is_callable($callable)) {
            $this->filters[$name][(int) $priority][] = $callable;
        }
    }
712966
public function merge(FilterChain $filterChain)
    {
        foreach ($filterChain->filters->toArray(PriorityQueue::EXTR_BOTH) as $item) {
            $this->attach($item['data'], $item['priority']);
        }

        return $this;
    }
525814
public function setFilter(\Sulu\Bundle\ResourceBundle\Entity\Filter $filter)
    {
        $this->filter = $filter;

        return $this;
    }
1336107
public function removeFilter(FilterInterface $filter)
    {

        $this->filters = array_filter($this->filters, function (FilterInterface $f) use ($filter) {

            return $f !== $filter;
        });

        return $this;
    }