Code Duplication    Length = 25-32 lines in 2 locations

src/PH/Bundle/PayumBundle/Form/Type/BankAccountType.php 1 location

@@ 13-44 (lines=32) @@
10
use Symfony\Component\Form\FormBuilderInterface;
11
use Symfony\Component\OptionsResolver\OptionsResolver;
12
13
class BankAccountType extends AbstractType
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function buildForm(FormBuilderInterface $builder, array $options)
19
    {
20
        $builder
21
            ->add('holder', TextType::class, [
22
                'label' => 'form.bank_account.holder',
23
            ])
24
            ->add('iban', TextType::class, [
25
                'label' => 'form.bank_account.iban',
26
            ])
27
        ;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function configureOptions(OptionsResolver $resolver)
34
    {
35
        $resolver
36
            ->setDefaults([
37
                'data_class' => BankAccount::class,
38
                'validation_groups' => ['ph'],
39
                'label' => false,
40
                'translation_domain' => 'PayumBundle',
41
            ])
42
        ;
43
    }
44
}
45

src/PH/Bundle/PayumBundle/Form/Type/MollieGatewayConfigurationType.php 1 location

@@ 13-37 (lines=25) @@
10
use Symfony\Component\Form\FormBuilderInterface;
11
use Symfony\Component\Validator\Constraints\NotBlank;
12
13
final class MollieGatewayConfigurationType extends AbstractType
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function buildForm(FormBuilderInterface $builder, array $options): void
19
    {
20
        $builder
21
            ->add('apiKey', TextType::class, [
22
                'constraints' => [
23
                    new NotBlank([
24
                        'groups' => 'ph',
25
                    ]),
26
                ],
27
            ])
28
            ->add('method', ChoiceType::class, [
29
                'choices' => [
30
                    'SEPA Direct Debit' => 'directdebit',
31
                    'Credit Card' => 'creditcard',
32
                    'One-off SEPA Direct Debit' => 'directdebit_oneoff',
33
                ],
34
            ])
35
        ;
36
    }
37
}
38