Wordpress mock on add_filter func.

@param string   $filterName
@param callback $filterCall
@param int      $prio
@param int      $numVars

@return self
963916
public function addFilter($filterName, $filterCall, $prio, $numVars)
    {
        $this->filters[] = $this->add($filterName, $filterCall, $prio, $numVars);

        return $this;
    }
303492
public void addFilter(Filter filter)
   {
      if (filter.isTaskFilter())
      {
         m_taskFilters.add(filter);
      }

      if (filter.isResourceFilter())
      {
         m_resourceFilters.add(filter);
      }

      m_filtersByName.put(filter.getName(), filter);
      m_filtersByID.put(filter.getID(), filter);
   }
510189
public FilterRegistration.Dynamic addFilter(String name, Filter filter) {
        return addFilter(name, new FilterHolder(requireNonNull(filter)));
    }
213008
public static function getFilters($filterNames = null)
    {
        if (! is_null($filterNames)) {
            if (! is_array($filterNames)) {
                $filterNames = [ $filterNames ];
            }

            return array_only(static::$filters, $filterNames);
        } else {
            return static::$filters;
        }
    }
287305
public void addFilter(Filter filter) {
    filter.setInitialContext(initialContext);

    int minIndex = Integer.MAX_VALUE;
    String[] before = filter.before();
    for (int i = 0; i < before.length; i++) {
        String s = before[i];
        int index = index(activeFilters, s);
        if (index < minIndex) {
          minIndex = index;
        }
      }
      if (minIndex == Integer.MAX_VALUE) {
        // -1 is more usable for not-found than MAX_VALUE
        minIndex = -1;
      }

    if (contains(filter.before(), FIRST_IN_PIPE)) {
      activeFilters.add(0, filter);
    } else if (minIndex != -1) {
      activeFilters.add(minIndex, filter);
    } else {
      activeFilters.add(filter);
    }
  }
404978
public void addRequestFilter(String name, RequestFilter requestFilter) {
    if (isRequestFilterAdded(name)) {
      throw new IllegalArgumentException("Duplicate request filter: " + name);
    }
    proxy.addRequestFilter(requestFilter);
    requestFilters.put(name, requestFilter);
  }
70529
public void add(HttpMethod httpMethod, FilterImpl filter) {
        add(httpMethod, filter.getPath() , filter.getAcceptType(), filter);
    }
444613
public function applyFilter($filter, $args = null)
    {
        $args = func_get_args();
        $args[0] = $this;
        return call_user_func_array(
            $filter instanceof Closure ? $filter : $this->getConnection()->getFilterCallback($filter),
            $args
        );
    }
133704
public function add(callable $filter, $priority = null)
    {
        $this->filters->insert($filter, $priority);

        return $this;
    }
413483
public function addFilter(string $name, string $filter): void{
        $this->filters[$name] = $filter;
    }
316465
private function addFilterReq($f, $p = FilterChain::DEFAULT_PRIORITY) {
		$this->_filtersReq->attach($f, $p);
	}
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
779505
public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
	{
		$data = array_merge(array($route, $request, $response), $parameters);

		return $this->events->until('router.filter: '.$filter, $this->cleanFilterParameters($data));
	}
259701
public function setFilter($filterId, array $params = array()) {
        if (!array_key_exists($filterId, $this->_options['filters'])) {
            throw new Garp_Browsebox_Exception('Filter "'.$filterId.'" not found in browsebox '.$this->getId().'.');
        }
        $filter = $this->_options['filters'][$filterId];
        $filter->init($params);
        
        try {
            $filter->modifySelect($this->_select);
        } catch (Garp_Browsebox_Filter_Exception_NotApplicable $e) {
            // It's okay, this filter makes no modifications to the Select object
        }

        // save the custom filters as a property so they can be sent along in the URL
        $this->_filters[$filterId] = $params;
        return $this;
    }
1135812
public function removeFilterHandler($filterName, $filterHandlerName, $priority = 50)
    {
        $this->removeHandler(self::FILTER, $filterName, $filterHandlerName, $priority);
    }
1017481
protected function get_filter_values($filtername) {
        $values = [];
        foreach ($this->filtersapplied as $filter) {
            if ($filter[0] == $filtername) {
                $values[] = $filter[1];
            }
        }
        return $values;
    }
116362
public function applyFilter($name, $filterArg = null)
    {
        if (!isset($this->hooks[$name])) {
            $this->hooks[$name] = array(array());
        }

        if (!empty($this->hooks[$name])) {
            // Sort by priority, low to high, if there's more than one priority
            if (count($this->hooks[$name]) > 1) {
                ksort($this->hooks[$name]);
            }
            foreach ($this->hooks[$name] as $priority) {
                if (!empty($priority)) {
                    foreach ($priority as $callable) {
                        $filterArg = call_user_func($callable, $filterArg);
                    }
                }
            }
        }

        return $filterArg;
    }