[2.2] [OptionsResolver] Added closure for allowed types

Added closure as validation type so custom types (like making sure an array is array[string]) can be validated.