protected function setAllowedTypes(OptionsResolver $resolver)
    {
        $allowed = ['ldap_query_builder', ['\Closure', 'LdapTools\Query\LdapQueryBuilder', 'null']];

        $reflection = new \ReflectionClass(get_class($resolver));
        $parameters = $reflection->getMethod('addAllowedTypes')->getParameters();

        if ($parameters[0]->isArray()) {
            $resolver->setAllowedTypes([$allowed[0] => $allowed[1]]);
        } else {
            $resolver->setAllowedTypes(...$allowed);
        }
    }