protected function applyFilter(FilterInterface $filter, $handler)
    {
        if (!($filter instanceof CustomApplyFilterInterface) || !is_callable($filter->getApplyFilterFunction())) {
            return $filter->applyFilter($handler);
        }

        return call_user_func($filter->getApplyFilterFunction(), $filter, $handler);
    }