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);
        }
    }
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);
        }
    }
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 ) ; } }
A rather ugly way of allowing compatibility with the resolver component for pre 2.6 versions.

@param OptionsResolver $resolver
A rather ugly way of allowing compatibility with the resolver component for pre 2 . 6 versions .