protected function appendFormField(FilterHasFormInterface $filter, FormBuilderInterface $filterFormBuilder)
    {
        if (!($filter instanceof CustomAppendFormFieldsInterface)) {
            $filter->appendFormFieldsToForm($filterFormBuilder);

            return $filter;
        }

        $callableFunction = $filter->getAppendFormFieldsFunction();

        if (!is_callable($callableFunction)) {
            /** @var FilterHasFormInterface $filter */
            $filter->appendFormFieldsToForm($filterFormBuilder);

            return $filter;
        }

        call_user_func($callableFunction, $filter, $filterFormBuilder);

        return $filter;
    }