public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(['choices' => function (Options $options) {
if (isset($options['subject'])) {
return $this->paymentMethodsResolver->getSupportedMethods($options['subject']);
}
return $this->paymentMethodRepository->findAll();
}, 'choice_value' => 'id', 'choice_label' => 'name', 'choice_translation_domain' => false])->setDefined(['subject'])->setAllowedTypes('subject', PaymentInterface::class);
}